aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-10Migrations: migration for 'genotype_resources' tableFrederick Muriuki Muriithi
* migrations/auth/20221110_04_6PRFQ-create-genotype-resources-table.py: new migration * tests/unit/auth/test_create_table_migrations.py: test new migration
2022-11-10Migrations: Add migration for 'phenotype_resources' tableFrederick Muriuki Muriithi
* migrations/auth/20221110_03_ka3W0-create-phenotype-resources-table.py: new migration * tests/unit/auth/test_create_table_migrations.py: test for new migration
2022-11-10Migrations: Add migration for mrna_resources tableFrederick Muriuki Muriithi
* migrations/auth/20221110_02_z1dWf-create-mrna-resources-table.py: new migration * tests/unit/auth/test_create_table_migrations.py: test for new migration
2022-11-10Migrations: Add migration for 'resources' tableFrederick Muriuki Muriithi
* gn3/migrations.py: Minor change * migrations/auth/20221110_01_WtZ1I-create-resources-table.py: new migration * tests/unit/auth/test_create_table_migrations.py: test new migration
2022-11-09Migrations: Add `resource_meta` field to `resource_categories` tableFrederick Muriuki Muriithi
2022-11-09Tests: Provide backend fixture to (apply|rollback)_single_migrationFrederick Muriuki Muriithi
2022-11-08Fix issue where only primary samples were used when all samples arezsloan
selected This is because base_samples was set to all_samples_ordered, which only includes primary samples + parents/f1s. Setting this to an empty list fixed the issue and caused it to use all samples again.
2022-11-08Migrations: Improve `resource_categories` data tests.Frederick Muriuki Muriithi
* tests/unit/auth/test_migration_init_data_in_resource_categories_table.py: Test that the data is initialised properly. Test that rollback works as expected.
2022-11-08Migrations: Init `resource_categories` with initial categoriesFrederick Muriuki Muriithi
* migrations/auth/20221108_04_CKcSL-init-data-in-resource-categories-table.py: new migration. * tests/unit/auth/test_migration_init_data_in_resource_categories_table.py: test new migration.
2022-11-08Migrations: Create `resource_categories` table.Frederick Muriuki Muriithi
* migrations/auth/20221108_03_Pbhb1-create-resource-categories-table.py: new migration. * tests/unit/auth/test_create_table_migrations.py: test new migration.
2022-11-08Migrations: Create `privileges` table.Frederick Muriuki Muriithi
* migrations/auth/20221108_02_wxTr9-create-privileges-table.py: new migration * tests/unit/auth/test_create_table_migrations.py: test new migration
2022-11-08Tests: Fix test name.Frederick Muriuki Muriithi
2022-11-08Tests: Fix typo: remove variable from quotes.Frederick Muriuki Muriithi
2022-11-08Add migration to create the groups table.Frederick Muriuki Muriithi
2022-11-08Tests: Generalise testing 'CREATE TABLE' migrationsFrederick Muriuki Muriithi
* gn3/settings.py: Omit trailing slash * tests/unit/auth/test_create_table_migrations.py: Generalise testing migrations that create tables. * tests/unit/auth/test_create_user_credentials_table.py: delete * tests/unit/auth/test_migration_create_users_table.py: delete
2022-11-08CLI: Provide `apply-migrations` command for flaskFrederick Muriuki Muriithi
* main.py: Provide the `apply-migrations` CLI command to run the migrations against the auth database. The command can be invoked with: $ flask apply-migrations
2022-11-08Settings: Provide default `AUTH_DB` setting.Frederick Muriuki Muriithi
2022-11-08Tests: Tests the credentials check systemFrederick Muriuki Muriithi
* gn3/auth/authentication.py: Fix issues caught by tests * tests/unit/auth/test_credentials.py: Add fixtures and tests for credentials checking
2022-11-08Tests: Test migration to create user_credentials tableFrederick Muriuki Muriithi
* tests/unit/auth/test_create_user_credentials_table.py: new tests
2022-11-08Tests: Separate *ALL* unit test fixtures from auth-specific onesFrederick Muriuki Muriithi
* tests/unit/auth/conftest.py: add fixtures specific to auth * tests/unit/auth/test_migration_create_users_table.py: import from new fixtures module * tests/unit/conftest.py: remove auth-specific fixtures from *ALL* unit tests fixture module.
2022-11-03Add credentials checkingFrederick Muriuki Muriithi
* gn3/auth/authentication.py: new function `credentials_in_database` * gn3/auth/authentication/__init__.py: replace package with module * gn3/settings.py: new `AUTH_MIGRATIONS` configuration variable * migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py: new migration * tests/unit/auth/test_credentials.py: test the `credentials_in_database` function * tests/unit/conftest.py: more test fixtures
2022-11-03Rename migration test.Frederick Muriuki Muriithi
2022-11-03Initialise the Auth(entic|oris)ation packagesFrederick Muriuki Muriithi
Initialise the authentication/authorisation system packages and set up the initial database migrations to set up the system. * README.md: Add documentation on migrations * gn3/auth/__init__.py: init package * gn3/auth/authentication/__init__.py: init package * gn3/auth/authorisation/__init__.py: init package * gn3/migrations.py: provide migration utilities * migrations/auth/20221103_01_js9ub-initialise-the-auth-entic-oris-ation-database.py: new migration * tests/unit/auth/test_init_database.py: test new migration applies and rolls back as expected * tests/unit/conftest.py: fixtures for unit tests * yoyo.auth.ini: basic configuration for yoyo-migration for auth system migrations
2022-11-02Re-implement RDF related code to use monads in its own moduleMunyoki Kilyungi
* gn3/api/general.py: Replace gn3.db.datasets import with gn3.db.rdf. (dataset_metadata) <jsonify>: Replace datasets.dataset_metadata with rdf.get_dataset_metadata. * gn3/db/datasets.py: Remove unused imports. (sparql_query, dataset_metadata): Delete. * gn3/db/rdf.py: (sparql_query, get_dataset_metadata): New functions.
2022-11-02Fix pylint and mypy errorsMunyoki Kilyungi
* gn3/db/sample_data.py (get_trait_csv_sample_data): Pass __query directly to cursor.execute. Rename value to _value in for loop to make mypy pass. * gn3/db_utils.py (Connection): Add class docstring. (Connection.cursor): Add docstring. * mypy.ini: Add an entry for xapian.
2022-11-02Add tests for monadic_dictMunyoki Kilyungi
* tests/unit/test_monads.py (test_monadic_dict): Add basic test-cases for MonadicDict.
2022-11-02Add type stubs for MaybeMunyoki Kilyungi
This allows Maybe[T] to be used as a type. Both Nothing and Just are of type Maybe. * mypy.ini: Add default location for stub files. * stubs/pymonad/__init__.pyi: New file. * stubs/pymonad/maybe.pyi: Ditto.
2022-10-28Use Xapian index path from app settings.Arun Isaac
App settings should be accessed from current_app. It should not be hard-coded to a variable in a module. * gn3/db_utils.py: Do not import XAPIAN_DB_PATH from gn3.settings. (xapian_database): Accept path argument. * gn3/api/search.py: Import current_app from flask. (search_results): Pass Xapian index path to xapian_database.
2022-10-28Disable various pylint checks on Connection class.Arun Isaac
* gn3/db_utils.py (Connection): Disable missing-class-docstring, missing-function-docstring and too-few-public-methods pylint checks.
2022-10-28Add search.Arun Isaac
* gn3/api/search.py: New file. * gn3/app.py: Register the search blueprint.
2022-10-26Add xapian database connection context manager.Arun Isaac
* gn3/settings.py (XAPIAN_DB_PATH): New variable. * gn3/db_utils.py: Import xapian and XAPIAN_DB_PATH from gn3.settings. (xapian_database): New function.
2022-10-25Reshape column major genotype database storage correctly.Arun Isaac
* gn3/genodb.py (matrix): Reshape column major genotype database storage as ncols x nrows instead of as nrows x ncols.
2022-10-22fix issue;parsing sample data (#102)Alexander Kabui
2022-10-18Add xapian indexing script.Arun Isaac
* scripts/index-genenetwork: New file. * setup.py (install_requires): Add click, pymonad and xapian-bindings. (scripts): Add scripts/index-genenetwork.
2022-10-18Support server side SQL query retrieval.Arun Isaac
* gn3/monads.py: Import SSDictCursor from MySQLdb.cursors. (query_sql): Add server_side argument.
2022-10-18Add database connection context manager.Arun Isaac
* gn3/db_utils.py: Import contextlib. Import Any, Iterator, Protocol and Tuple from typing. (database_connector): Deprecate function. (Connection): New class. (database_connection): New function.
2022-10-18Add monadic utilities.Munyoki Kilyungi
* gn3/monads.py: New file. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
2022-10-08README: a note on designPjotr Prins
2022-10-06DEBUG: Collect more info for debuggingFrederick Muriuki Muriithi
2022-10-06DEBUG: Collect more information on possible failure.Frederick Muriuki Muriithi
2022-10-03Bug: Do not process data for output too earlyFrederick Muriuki Muriithi
* gn3/computations/rust_correlation.py: (parse_tissue_corr_data): The function was parsing data from a file, and then converting the parsed values into a comma-separated string for output, despite the fact that the data parsed is not output in this specific function. This is a really bad idea, and leads to errors showing up down the line, far removed from the cause.
2022-09-30Add escape char to avoid error notice.Frederick Muriuki Muriithi
2022-09-29Use the built-in csv module for file outputFrederick Muriuki Muriithi
Use the built-in csv module for file output in order to avoid subtle errors in the formats.
2022-09-06Update link to continuous deployment.Arun Isaac
* README.md: Update link to continuous deployment.
2022-08-30Update test: include port in parsed data from mysql uriFrederick Muriuki Muriithi
2022-08-25revert for commit 6db3b2af8fc09999996d3acc09890a06f179c669;BugAlexander_Kabui
2022-08-23Remove conn.commit() and conn.rollback()Munyoki Kilyungi
* gn3/db/__init__.py (update): Delete conn.commit() and conn.rollback() (insert): Ditto. * gn3/db/case_attributes.py (insert_case_attribute_audit): Ditto. (reject_case_attribute): Ditto. (approve_case_attribute): Ditto. * gn3/db/sample_data.py (update_sample_data): Ditto. (delete_sample_data): Ditto. (insert_sample_data): Ditto.
2022-08-22Use non-default MySQL port if presentFrederick Muriuki Muriithi
By default, MySQL/Mariadb connects at port 3306, however, the configuration variable `SQL_URI` could contain a different port. In that case, this commit allows the system to connect to the non-default port.
2022-08-12Add mandatory/expected fields to parsed data.Frederick Muriuki Muriithi
2022-08-10Fix returned value for 'parse_correlation_output'Frederick Muriuki Muriithi
* Always return dict * Fix internal '__parse_line__' to always have a valid return