aboutsummaryrefslogtreecommitdiff
path: root/gn3/data_helpers.py
AgeCommit message (Collapse)Author
2022-02-21Fix a myriad of linter issuesFrederick Muriuki Muriithi
* Use `with` in place of plain `open` * Use f-strings in place of `str.format()` * Remove string interpolation from queries - provide data as query parameters * other minor fixes
2021-11-09Add new data processing utilityFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: New function (`partition_by`) * tests/unit/test_data_helpers.py: Tests for new function Add a function that approximates Clojure's `partition-by` function, to help with processing the data in a more functional way.
2021-11-01Fix some linting errorsFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi
2021-11-01Parse single line from CSV fileFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: New function (parse_csv_line) * tests/unit/test_data_helpers.py: Add tests for new function (parse_csv_line) Add a function to parse a single line from a CSV file.
2021-10-25Implement `partition_all` functionFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: new function (partition_all) * tests/unit/test_data_helpers.py: tests for function `gn3.data_helpers.partition_all` As part of migrating some functions that access the database, this commit extracts generic processes that can be accomplished on data, and implements the `partition_all` function, that is equivalent to Clojure's `partition-all` function.