aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db
AgeCommit message (Collapse)Author
2021-08-09Set up the trait dataset type correctlyMuriithi Frederick Muriuki
* gn3/db/traits.py: setup `trait_dataset_type` * tests/unit/db/test_traits.py: fix tests The type ('Temp', 'Geno', 'Publish', and 'ProbeSet') relate to a trait's dataset, and not the trait itself. This commit updates the code to take this into consideration. The dataset type is also set up from a trait's full name, therefore this commit removes the `trait_type` argument from the `retrieve_trait_info` function.
2021-08-09Fix linting errorsMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Add module, class and function docstrings * Deactivate some irrelevant pylint errors * Fix indentations and line-lengths
2021-08-08Update testsMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Fix tests to take current changes into consideration.
2021-08-05Reorganise the database codeMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Reorganise the code to separate the datasets from the traits, and to more closely conform to the same flow as that in GN1
2021-08-05Build up trait_name items from full nameMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * The full name of the traits from search contains multiple parts to it, and as such, we use it to retrieve the appropriate data and set it up in the final trait_info dictionary that is produced.
2021-08-04Fix issues caught by pylintMuriithi Frederick Muriuki
* gn3/computations/slink.py: remove unused imports * gn3/db/traits.py: remove unnecessary `else` clauses * tests/unit/db/test_traits.py: add docstrings for functions
2021-08-04Retrieve the RISet and RISet ID valuesMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Retrieve the RISet and RISet ID values from the database.
2021-08-04Add tests for post-processing functionsMuriithi Frederick Muriuki
Issues: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Add missing tests for some post-processing functions
2021-08-04Update testsMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Update the tests to deal with changes in the code.
2021-07-30Remove extra spaceMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Remove extra space that was causing test to fail.
2021-07-30Return dict from query functionsMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/db/traits.py: return dicts rather than tuples/list * tests/unit/db/test_traits.py: Update tests Return dicts with the key-value pairs set up so as to ease with the data manipulation down the pipeline. This is also useful to help with the retrieval of all other extra information that was left out in the first iteration. This commit also updates the tests by ensuring they expect dicts rather than tuples.
2021-07-29Merge branch 'main' into Feature/Update-db-from-csv-dataBonfaceKilz
2021-07-29Delete "update_raw" and it's test-casesBonfaceKilz
2021-07-29Add method for updating values from a sample datasetBonfaceKilz
* gn3/db/traits.py (update_sample_data): New function. * tests/unit/db/test_traits.py: New test cases for ^^.
2021-07-29Retrieve trait informationMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/db/traits.py: add functions to retrieve traits information * tests/unit/db/test_traits.py: add tests for new function Add functions to retrieve traits information as is done in genenetwork1 https://github.com/genenetwork/genenetwork1/blob/master/web/webqtl/base/webqtlTrait.py#L397-L456 At this point, the data retrieval functions are probably incomplete, as there is more of the `retrieveInfo` function in GN1 that has not been considered as of this commit.
2021-07-29Make name retrieval more generalMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/db/traits.py: make function more general * tests/unit/db/test_traits.py: parametrize the tests Make the name retrieval more general for the different types of traits by changing the column specification and table as appropriate.
2021-07-29Retrieve 'ProbeSet' trait nameMuriithi Frederick Muriuki
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/db/traits.py: new function (retrieve_probeset_trait_name) * tests/unit/db/test_traits.py: test(s) for new function Add a function to retrieve the name of a 'ProbeSet' trait in a manner similar to genenetwork1's retrieval of the same, as implemented here https://github.com/genenetwork/genenetwork1/blob/master/web/webqtl/base/webqtlDataset.py#L140-154 Unlike in genenetwork1, we do not mutate an object, instead, we return the values as retrieved from the database, and the caller will deal with the returned values as appropriate.
2021-07-26tests: test_db: Add test case for "update_raw"BonfaceKilz
2021-07-10Fix pylint issuesBonfaceKilz
2021-07-10db: test_db: Test that a fetch is correct when columns are specifiedBonfaceKilz
2021-06-07db: test_db: Add extra variable in test data for "id"BonfaceKilz
2021-06-07Rename json_data column to json_diff_dataBonfaceKilz
2021-06-07tests: test_db: Add a test-case for fetchallBonfaceKilz
2021-06-07tests: test_db: Rename TestPhenotypeBonfaceKilz
2021-06-07tests: test_phenotype: Rename to test_dbBonfaceKilz
2021-06-03Use prepared statements for FETCH sql functionBonfaceKilz
2021-06-03Use prepared statements for UPDATE sql functionBonfaceKilz
2021-06-03tests: test_audit: Update test case to check for prepared statementsBonfaceKilz
2021-06-03Add data structures for the table metadata_auditBonfaceKilz
2021-06-03unit: test_phenotypes: Test for multiple "WHERE" clausesBonfaceKilz
2021-06-03Get the diff between 2 dicts and return that as a dictBonfaceKilz
2021-05-26Move the methods, "update" and "fetch", to gn3.dbBonfaceKilz
2021-05-20tests: test_phenotype: Add function that tests "fetchone"BonfaceKilz
2021-05-20db: phenotypes: Update failing testsBonfaceKilz
2021-05-20tests: test_phenotypes: New test cases for loading phenotypesBonfaceKilz
2021-05-10tests: test_species: Add test for `get_all_species`BonfaceKilz
2021-05-08tests: test_species: New testsBonfaceKilz