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

Enh/setup cleanup #287

Merged
merged 32 commits into from
Dec 21, 2023
Merged

Enh/setup cleanup #287

merged 32 commits into from
Dec 21, 2023

Conversation

bzah
Copy link
Member

@bzah bzah commented Dec 15, 2023

Pull Request to resolve #259

  • Unit tests cover the changes.
  • These changes were tested on real data.
  • The relevant documentation has been added or updated.
  • A short description of the changes has been added to doc/source/references/release_notes.rst.

Describe the changes you made

TODO:

  • Complete the pyproject.toml with the linter and formatter configuration
    • For now a few rules are disabled (either commented in select or added to ignore in pyproject.toml).
      They should be added step by step and will help improve the code quality.
  • Migrate to ruff for linting
  • Update CI to install requirements from toml file instead of requirement for test, logo generation, API generation and doc generation
  • Remove ICCLIM_VERSION from constants and use icclim.version instead (investigate if that's possible without issues)

Abel Aoun added 2 commits December 15, 2023 09:50
- Moved tests dir to root
- Moved icclim package to a new src dir
  The above are to follow the best practice describe in:
  https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
  From the Python Packaging Authority.

- Update build and release process to avoid using deprecated features
  Now we will use `flit` and `build` tools to build icclim
  releases.

- Remove setup.py in favor of the more modern pyproject.toml

- Remove requirement.txt and requirement-dev.txt thanks to
  pyproject.toml
environment.yml Outdated Show resolved Hide resolved
Abel Aoun added 13 commits December 18, 2023 14:48
This will avoid getting some segmentation fault.

Context
-------
Since v1.6.1 of netcdf4 py the version used for netcdf-c
release the GIL. However, netcdf-c is not thread safe so
from times to times threads may mess with each other when
we use dask parallelization to open multiple datasets at
once.
Copy link

github-actions bot commented Dec 19, 2023

Coverage

Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icclim
   _generated_api.py178995%17–27
   icclim_logger.py852966%24, 43, 65, 70–95, 105, 111–142, 150–155
   icclim_types.py13130%1–21
   main.py2833488%59–65, 125, 134, 415–419, 502, 528–529, 531–532, 534, 536–537, 539–540, 560–567, 637–642, 727, 734, 738–739
   utils.py40880%14–15, 25–30, 37–41, 43–44
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icclim/ecad
   xclim_binding.py52885%16–18, 44, 48, 77, 81, 110, 114
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icclim/generic_indices
   generic_indicators.py4989880%49–55, 68, 72, 89, 93, 97, 110–113, 117, 191, 333–337, 339–343, 389, 420–421, 723–724, 759, 765, 773–774, 794, 958–962, 964–965, 983–989, 993, 1021, 1023, 1091–1092, 1125–1151, 1179–1199, 1215, 1224–1225, 1252–1284, 1290–1293, 1315
   standard_variable.py48198%19
   threshold.py4113492%49–54, 209–210, 234, 238, 286, 302–304, 319–323, 327–331, 411, 553–554, 617–622, 717–718, 913, 936–937, 942, 1016–1017, 1020–1024, 1112–1114
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icclim/models
   cf_calendar.py35197%20
   climate_variable.py1062180%27–34, 107–113, 168–169, 178, 214–218, 221, 261, 265–269, 296–297, 334
   frequency.py1801592%36–38, 174–177, 321–327, 331, 414–418, 440, 445
   global_metadata.py660%1–9
   index_config.py27581%7–11
   index_group.py35294%33–37
   logical_link.py21195%12
   operator.py31390%10, 15–19
   standard_index.py30680%7–10, 59, 62, 66
   user_index_dict.py20200%1–28
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/icclim/pre_processing
   in_file_dictionary.py880%1–29
   input_parsing.py2055374%22–28, 81–82, 86–87, 92–97, 111–112, 180, 185–189, 192, 202–203, 214–218, 244, 258, 272, 293–298, 302, 304, 312–317, 322–327, 338–339, 353–360, 369–389, 414
   rechunk.py89693%21–22, 43–44, 48, 136
TOTAL264338186% 

Test results

Tests Skipped Failures Errors Time
189 0 💤 0 ❌ 0 🔥 1m 34s ⏱️

@bzah bzah marked this pull request as ready for review December 21, 2023 12:36
@bzah
Copy link
Member Author

bzah commented Dec 21, 2023

There is a drop of the code coverage in this PR, from 91% to 86%.
It is without consequences because the only statements that are now uncovered are the types declarations.
These are now bypassed at runtime with the addition of if TYPE_CHECKING in imports.

tools/build.sh Outdated Show resolved Hide resolved
@bzah bzah merged commit aff2858 into master Dec 21, 2023
5 checks passed
@bzah bzah deleted the enh/setup-cleanup branch December 21, 2023 14:23
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.

ENH: migrate to project.toml
1 participant