Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.2.5 #934

Merged
merged 77 commits into from Oct 14, 2022
Merged

Release 0.2.5 #934

merged 77 commits into from Oct 14, 2022

Conversation

WeilerP
Copy link
Member

@WeilerP WeilerP commented Oct 3, 2022

Changes

  • Catch non-positive parameter values and raise a ValueError if necessary.
  • get_mean_var uses the same size parameter for mean and variance.
  • Increased unit test coverage.
  • Move unit tests to tests/ module outside of scvelo/.

Bug fixes

  • filter_genes now works with adata.layers['unspliced'] being sparse and adata.layers['spliced'] dense.
  • show_proportions actually considers the layer "ambiguous" if present.
  • Fix calculation of Pearson's correlation in csr_vcorrcoef.
  • Fix get_mean_var to work with sparse input and ignore_zeros=True.
  • Fix bug in neighbor calculation.
  • Fix optimization.py::get_weight to work with numeric, non-integer values.
  • Fix inference with fit_scaling=False.
  • Fix saving of velocity embedding stream.
  • Fix Pandas' display precison when passed to get_df.

Add test class for `scvelo/core/_anndata.py::clean_obs_names`.
* Rename input arguments from `data` to `adata`, `copy` to `inplace`,
`ID_length` to `id_length`, `base` to `alphabet`.

* Rename variables to something more meaningful and use snake as well as
lower case, consistently.

* Make use of Pandas functionality.

* Use regex expression.
* Move `scvelo/core/tests` to `tests/core`

Moves unit tests `scvelo/core/tests` to `tests/core`. This will, for
example, prevent installation files becoming large when including data
or ground truth figures.

* Add `tests/__init__.py`

Makes `tests/` a package. This is needed to e.g. import from `tests/core`
later on.

* Update pytest.ini

Remove `scvelo` from testpaths.
* Add `multiply`

Adds function to calculate the element-wise product of two arrays or an
array and a sparse matrix.

* Fix and refactor `filter_genes`

The original implementation fails when `adata.layers['unspliced']` is
sparse but `adata.layers['spliced']` dense. The element-wise
multiplication is now performend using `multiply`.
* Fix and update docstrings

Update docstrings to follow codebase style.

* Add option to add columns to adata.obs

* Adds `obs_col_names`, `min_obs_cols`, `max_obs_cols` to composite
strategy `get_adata`. Using `obs_col_names`, the column names can be set
manually, the other arguments allow setting the minimum and maximum
number of columns generated.

* Updates unit tests to encounter for and test changes.

* Add option to add columns to adata.var

* Adds `var_col_names`, `min_var_cols`, `max_var_cols` to composite
strategy `get_adata`. Using `var_col_names`, the column names can be set
manually, the other arguments allow setting the minimum and maximum
number of columns generated.

* Updates unit tests to encounter for and test changes.
* Add method `_subset_columns` to `TestBase`

Adds method to sample from column names in `adata.obs` and `adata.var`.

* Add `TestCleanup`

Adds test class to unit test `scvelo/core/_anndata.py::cleanup`.
* Rename argument `data` to `adata`

* Rename argument `copy` to `inplace`

* Update type hint in `cleanup`

* Rename variables

Rename variables to use more informative names.
* Delete `pl.py`, `pp.py` and `tl.py`.
* Update `__init__.py` to no longer rely on `pl.py`, `pp.py` and
`tl.py`.
* Update `get_modality`

Support passing `None` for argument `modality`. In this case, `adata.X`
is returned.

* Add `TestGetModality::test_modality_equals_none`

Add unit test to check that correct modality is extracted if `None` is
passed for `modality` in `get_modality`.
* Rename `layer` to `modality`

Rename argument `layer` to `modality` in `get_size`. This unifies naming
convention for the argument across the code base and prepares
generalizing `get_size` to arbitrary modalities.

* Generalize `get_size` to arbitrary modalities

This allows calculating the size per observation for any modality, from
`adata.X`, `adata.layers` or `adata.obsm`.

* Update docstrings
Unit tests `scvelo.core._anndata.py::obs_df`.
Unit tests `scvelo.core._anndata.py::var_df`.
The addition assert statement checks that the index of the returned data
frame is correct.
Unit tests `scvelo.core._anndata.py`::show_proportions`.
Reduce maximum size of generated AnnData objects in some tests.
* Run tests on ubuntu-latest using both Python 3.7 and 3.8.

* Increase verbosity of pytest.

* Add timeout to tests.
Add files and directories created by `pytest-cov`.
Change order of default layers to match temporal ordering in biological
process.
In TestShowProportions::test_layers_not_specified, layers should not be
specified but `layers=None` passed instead.
Check that `inplace` argument is working correctly.
Add unit tests to `TestMakeDense` and
`TestMakeSparse` when `modality` is passed as a string.
Generate layer names with at least two characters to exclude the case
`layer='X'`.
Converts unit test to a test class. 2D arrays and sparse matrices are
now generated as well to increase coverage to 100%.
* Add `varm` to AnnData strategy

Strategy can now also add entries to `adata.varm`. This is tested by
extending the existing unit tests.

* Set `max_obs` and `max_vars` to `5`

This is an attempt to make the unit tests not in the CI on GitHub due to
a time out error by Hypothesis.
WeilerP and others added 20 commits December 27, 2021 18:02
* Update `ci.yml`

Remove testing of dataset download from job `test`. Instead, a new job
`test-dataset-downloads` is added.

* Update `ci.yml`

Print execution time of 25 slowest tests.

* Update `test_datasets.py`

Skip `test_datasets.py::TestDataSets` if Python version is not 3.8 and
OS is not Linux.
* Split body of `neighbors` over several functions

Split body of `neighbors` over several function for easier unit testing.

* Add type hints to arguments of `neighbors`

* Fix typo in docstrings
The variable `rep` is referenced before assignment if the if-else case
is not entered. This is fixed by adding a final `else` case. In the
following, only the variable `rep` is used.
* Update `requirements-dev.txt`

Add `pytest-cov` to the installed libraries.

* Update `ci.yml`

Update how dependencies are installed in the `test` job.
To prevent test failure due to exceeding deadlines, the default deadline
of Hypothesis is increased to 500 milliseconds when running the tests
in the CI.
* Add `test_neighbors.py`

Add file to host unit tests for `preprocessing/neighbors.py`.

* Add `TestGetNeighs`

* Add `TestGetNNeighs`

* Add `TestGetDuplicateCells`

* Add `TestRemoveDuplicateCells`

* Add preprocessed adata for testing

Add preprocessed versions of `dentategyrus_50obs.h5ad`,
`dentategyurs_100obs.h5ad`, `pancreas_50obs.h5ad`, and
`pancreas_100obs.h5ad`.

* Add fixtures for preprocessed datasets

Add fixtures to use preprocessed datasets in unit tests.

* Add fixture `adata`

The fixture `adata` is used to easily load raw or preprocessed datasets
in unit tests. This allows running one and the same unit test on all
available datasets.

* Add `TestSelectConnectivities`

Add unit tests for `select_connectivities`.

* Add `TestSelectDistances`

Add unit tests for `select_distances`.

* Add `TestSetDiagonal`

Add unit tests for `set_diagonal`.

* Add `TestNeighborsToBeRecomputed`

Add unit tests for `neighbors_to_be_recomputed`.

* Add `TestVerifyNeighbors`

Add unit tests for `verify_neighbors`.

* Add `TestGetConnectivities` and accompanying files

Add unit tests for `get_connectivities` and saved CSR matrices to verify
results.

* Add `TestGetCsrFromIndices`

Add unit tests for `get_csr_from_indices`.

* Add `TestComputeConnectivitiesUmap`

Add unit tests for `compute_connectivities_umap`

* Add `TestGetRep`

Add unit tests for `_get_rep`.

* Add `TestSetPCA`

Add unit tests for `_set_pca`.

* Add `TestGetHnswNeighbors`

Add unit tests for `_get_hnsw_neighbors` and corresponding CSR matrices
saved using `.npz` format.

* Add `TestGetScanpyNeighbors`

Add unit tests for `_get_scanpy_neighbors` and corresponding CSR
matrices saved using `.npz` format.

* Add `TestGetSklearnNeighbors`

Add unit tests for `_get_sklearn_neighbors` and corresponding CSR
matrices saved using `.npz` format.

* Add `TestNeighbors`

Adds unit tests for the function `neighbors`.
* Add `test_moments.py`

Add file to host unit tests of functions in `moments.py`.

* Add `TestGetMoments`

Add unit tests for `get_moments` and corresponding ground truth moments
saved using `.npy` format.

* Add `TestSecondOrderMomentsU`

Add unit tests for `second_order_moments_u`.

* Add `TestSecondOrderMoments`

Add unit tests for `second_order_moments` and corresponding moments
saved using `.npy` format.

* Add `TestMagicImpute`

Add unit tests for `magic_imput` and corresponding imputed data saved
using `.npy` format.

* Add `TestMoments`

Add unit tests for `moments` and corresponding first order moments saved
using `.npy` format.

* Update `requirements-dev.txt`

Add `magic-impute` to run unit tests on CI.
Recommend `kb count` instead of `loompy fromfq`.
Excludes `pandas==1.4.0` to prevent failure as reported in #811.
Fix `scvelo.tools.optimization.py::get_weight` to work correctly when
`perc` is numeric.
* Update `DynamicsRecovery`
Fix parameter inference to not fit scaling when `fit_scaling=False`.
* Update `requirements-dev.txt`

Update versions of `black` and `isort`.

* Update `.pre-commit-config.yaml`

Update repo paths and versions.

* Run `black`

Run code formatting with latest version of `black`.
Adds argument `file_path` to datasets added in `scvelo=0.2.4.`.
Details workaround to issue where `pip install -e '.[dev]'` leads to
errors on Windows.
* Fix missing write_key for embedding stream plot.

* Set save instead of wire_key when saving embedding stream plot.
* Fix bug with clean_obs_names

Switched implementation to use the previously ignored id_length
parameter. New approach finds a substring of length id_length
where each of the letters are in the alphabet

* Extend tests to cover more cases for clean_obs_names
* Update `core/_anndata.py`

Update how Pandas displayed precision is set.

* Update `core/_anndata.py`

Add TODO comment to add a unit test to test the `precision` argument.
* Update `CONTRIBUTING.rst` [ci skip]

Update branch name convention.

* Update `docs/requirements.txt` [ci skip]

Pin `Jinja` version.

* Update `docs/source/conf.py` [ci skip]

Update `add_stylesheet` with `add_css_file`. The former is deprecated.

* Fix typo in `index.rst` [ci skip]

* Fix link to bone marrow dataset [ci skip]

* Fix `velocity_embedding` docs [ci skip]
* Add `_key_contributors.rst` [ci skip]

Add file with key contributors and their roles.

* Show key contributors on index page [ci skip]
* Add `core/_utils.py`

* Add `core/_utils.py::deprecated_arg_names`

Modify wrapper from Scanpy to replace old with new keyword argument.
The wrapper is modified s.t. `copy=True` corresponds to `inplace=False`,
and vice versa.

* Make `deprecated_arg_names` importable from `core`

* Update import of `deprecated_arg_names`

Import local version instead of the Scanpy version s.t. the keyword
argument `copy` is handled correctly.
@WeilerP WeilerP added the release PR or commit for release label Oct 3, 2022
@WeilerP
Copy link
Member Author

WeilerP commented Oct 3, 2022

FYI, @adamgayoso.

Remove reference to `develop` branch as it will be removed in the next
release.
* Fix `TestLinearRegression::test_perfect_fit`

Replace `array` strategy to generate `x` with `sampled_from`.

* Fix `TestLinearRegression::test_perfect_fit_2d`

Replace `array` strategy to generate `x` with `sampled_from`.
@WeilerP WeilerP marked this pull request as draft October 11, 2022 05:16
Remove failing and non-essential unit tests.
See #922.
* Remove trailing white spaces

* Add notes for `0.2.5` release
@WeilerP WeilerP marked this pull request as ready for review October 14, 2022 09:31
@WeilerP WeilerP merged commit ce52f58 into master Oct 14, 2022
@WeilerP WeilerP deleted the develop branch January 18, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release PR or commit for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants