From b602c2c651dca0ea43cc2fe59ec64c99298a5730 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 22 Sep 2022 16:12:09 -0500 Subject: Closing issue because bug has been fixed --- issues/mapping-haley-knott-regression-chromosome-zoom-in-bug.gmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/issues/mapping-haley-knott-regression-chromosome-zoom-in-bug.gmi b/issues/mapping-haley-knott-regression-chromosome-zoom-in-bug.gmi index d6064a4..8dea1e0 100644 --- a/issues/mapping-haley-knott-regression-chromosome-zoom-in-bug.gmi +++ b/issues/mapping-haley-knott-regression-chromosome-zoom-in-bug.gmi @@ -2,7 +2,7 @@ ## Tags -* status: open +* status: closed * keywords: mapping, Haley-Knott Regression * priority: medium * type: bug -- cgit v1.2.3 From 40e70f16479ef246639b240d4b0a1e751be191b1 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Sun, 25 Sep 2022 21:37:36 +0300 Subject: Create a new issue on reworking settings * issues/rework-settings.gmi: New file. --- issues/rework-settings.gmi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 issues/rework-settings.gmi diff --git a/issues/rework-settings.gmi b/issues/rework-settings.gmi new file mode 100644 index 0000000..e2e6885 --- /dev/null +++ b/issues/rework-settings.gmi @@ -0,0 +1,19 @@ +# Rework Fetching Settings + +* assigned: bonfacem, zsloan, alex, fredm +* tags: refactor + +In GN2, We fetch all our settings from the "wqflask.utility.tools". This module contains many functions that are only used once. As an example, consider this function which is defined in the aforementioned module: + +``` +def flat_files(subdir=None): + base = get_setting("GENENETWORK_FILES") + if subdir: + return assert_dir(base + "/" + subdir) + return assert_dir(base) +``` + +It's only used once in "wqflask/base/data_set/datasetgroup.py". ATM, now we have a more generic way of fetching settings from wqflask.database, appropriately called "get_setting". Perhaps, when this task is being worked on, we should move that "get_setting" to a more appropriately named module. + +Getting rid of how we currently fetch settings will make things less complex, and we get rid of many "asserts". This will force us to deal with missing values more gracefully; and as an example with how we handle missing values in global search using the Maybe Monad. + -- cgit v1.2.3 From 03e406922683ed6e90c22a822967f245f49da6b8 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Sun, 25 Sep 2022 22:09:06 +0300 Subject: Add useful resources on learning monads * topics/maybe-monad.gmi (Useful Resources): Add new section. --- topics/maybe-monad.gmi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/topics/maybe-monad.gmi b/topics/maybe-monad.gmi index 5ec582c..7f2afa9 100644 --- a/topics/maybe-monad.gmi +++ b/topics/maybe-monad.gmi @@ -50,3 +50,11 @@ with conn.cursor(utility.monads.MonadicDictCursor) as cursor: for row in cursor.fetchall(): row["foo"].bind(print) ``` + +## Useful Resources + +=> https://www.miguelfarrajota.com/2021/06/monads-in-python-with-pymonad/ + +=> https://jasondelaat.github.io/pymonad_docs/explanations/whats-a-monad.html + +=> https://simon.tournier.info/posts/2021-02-03-monad.html -- cgit v1.2.3 From b992ade9e93f0235f79a9b28017ba022f724862a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 27 Sep 2022 06:24:31 +0300 Subject: topics: fix typo in documentation. --- topics/queries-and-prepared-statements-in-python.gmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topics/queries-and-prepared-statements-in-python.gmi b/topics/queries-and-prepared-statements-in-python.gmi index 642ed96..969c27f 100644 --- a/topics/queries-and-prepared-statements-in-python.gmi +++ b/topics/queries-and-prepared-statements-in-python.gmi @@ -29,7 +29,7 @@ curr.execute( WHERE Strain.Name IN ({}) and Strain.SpeciesId=Species.Id and Species.name = %s - """.format(", ".join(sample_data_keys)), + """.format(", ".join(["%s"] * len(sample_data_keys))), (sample_data_keys + (dataset.group.species,))) ``` -- cgit v1.2.3