From b5c5f49d2608e5b7e4dce56bb77d2514c4456d98 Mon Sep 17 00:00:00 2001 From: Ilan Gold Date: Fri, 28 Jan 2022 22:27:56 +0100 Subject: [PATCH] Fix Code Issues to Get Unit Tests Running (#121) * First pass. * Action on push * Install deps. * ubuntu 20? * Ok, just mac * Try commenting out the partially implemented models? * Let failing tests fail * Tests failing now only for `sample_description_from_xarray` and code-issues * Fix location and design matrices * Remove method init_par from Estimator * Remove rcond because dask doesn't support? * check chunk type for dask * Fix tf + dask compat issue. * Remove TF1 and TF2 Tests * Downgrade `sparse` * Make sure arrays are not immutable * Remove TF mentions * Remove TF2 * Remove TF from requirements.txt * Undo erroneous deletion of dep * Remove constants. * Remove constants. * Fix small tensorflow merges issues. Co-authored-by: David S. Fischer --- .github/workflows/test.yml | 19 +++++++++ README.md | 12 ++++++ batchglm/models/base/input.py | 6 ++- batchglm/models/base_glm/simulator.py | 6 +++ batchglm/train/numpy/base_glm/estimator.py | 6 ++- batchglm/unit_test/test_acc_glm_all_numpy.py | 4 -- .../unit_test/test_extreme_values_glm_all.py | 18 ++++----- batchglm/unit_test/test_graph_glm_all.py | 40 +++++++++---------- requirements.txt | 9 +++++ 9 files changed, 82 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3f2bf3bd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +on: push +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + python-version: [ '3.6' ] + name: Python ${{ matrix.python-version }} Tests + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Install Dependencies + run: pip install -r requirements.txt + - name: Run Tests + run: python -m unittest \ No newline at end of file diff --git a/README.md b/README.md index 95d70bdc..79fbd448 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,18 @@ # Fast and scalable fitting of over-determined generalized-linear models (GLMs) batchglm was developed in the context of [diffxpy](https://github.com/theislab/diffxpy) to allow fast model fitting for differential expression analysis for single-cell RNA-seq data. However, one can use batchglm or its concepts in other scenarios where over-determined GLMs are encountered. + +``` +pip install -r requirements.txt +``` + +To run unit tests: + +``` +pip install -e . +python -m unittest +``` +