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

Tests for the IO module #492

Merged
merged 40 commits into from
Nov 20, 2024
Merged

Tests for the IO module #492

merged 40 commits into from
Nov 20, 2024

Conversation

RondeauG
Copy link
Collaborator

@RondeauG RondeauG commented Nov 11, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • CHANGELOG.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

  • Mainly adds tests to the IO module, along with bugfixes:
    • Adds a missing library (openpyxl) to the requirements.
    • Improves the code in estimate_chunks to support n dimensions.
    • Fixes a bug in subset_maxsize where the last year would be dropped.
    • Fixes a bug in clean_incomplete where the zmetadata file would not be removed.
    • Added more flexibility to clean_incomplete.
    • Fixed a bug in _coerce_attrs where encoding would get dropped.
    • Fixed bugs in save_to_zarr with mode=='a': encoding of existing variables is now always dropped & the code now crashes if trying to both append dimensions with new data and add a new variable to an existing zarr.
    • Fixed bugs in save_to_zarr where the code would crash when skipping a variable if bitround was not None.
    • Fixed a bug in make_toc where the French name for the sheet would get dropped if given a Dataset instead of a DataArray.
    • Better default argument for column in save_to_table. It stays unchanged if given a Dataset with multiple variables, but is now None otherwise.
    • Fixed a bug in save_to_table where engine_kwargs would not be used if saving an Excel with a single sheet.
  • An option was added to publish_release_notes to only print the notes relevant to the latest version, rather than the whole Changelog.

Does this PR introduce a breaking change?

-To remove some clutter, publish_release_notes and show_versions have been moved from utils.py to testing.py.

Other information:

environment-dev.yml Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

src/xscen/io.py Show resolved Hide resolved
src/xscen/io.py Outdated Show resolved Hide resolved
src/xscen/io.py Show resolved Hide resolved
src/xscen/testing.py Outdated Show resolved Hide resolved
tests/test_testing.py Show resolved Hide resolved
Zeitsperre added a commit to Ouranosinc/xclim that referenced this pull request Nov 15, 2024
### What kind of change does this PR introduce?

* Fixed an issue that was causing URLs to include a `//` between the
repository and branch fields.

### Does this PR introduce a breaking change?

No.

### Other information:

While this was working fine for returning files already available on
disk, when `nimbus` was fetching files remotely when launched from a
Jupyter notebook, this was failing.

Related: Ouranosinc/xscen#492
@RondeauG RondeauG merged commit d38c83f into main Nov 20, 2024
16 checks passed
@RondeauG RondeauG deleted the road_to_90cov branch November 20, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants