• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ouranosinc / xclim / 13270676869
92%

Build:
DEFAULT BRANCH: main
Ran 11 Feb 2025 07:18PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
13270676869

push

github

web-flow
Refactor missing methods (#2058)

<!--Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [x] This PR addresses an already opened issue (for bug fixes /
features)
- This PR fixes #2000 and fixes #1820 and should please @tlogan2000 .
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [x] CHANGELOG.rst has been updated (with summary of main changes)
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added

### What kind of change does this PR introduce?
Refactor of the Missing objects. I tried to follow a more orthodox OOP
approach. In the new way:

- Objects are initialized with their options, called with the data (+
freq, src_timestep, indexer)
- Subclasses should override:
+ `__init__` to explicitly override the signature and document their
options, but this method should not do anything.
+ `validate`, a static method, which returns False on invalid options
(this is the same as before).
+ `is_missing`, which receives `null`, `count` and `freq`. It does the
same as before.
+ (optionnaly) `_validate_src_timestep`, to validate the `src_timestep`
at call time. Only useful for MissingWMO which is restricted to daily
inputs.
- Before, input validation was done in a few places, now it is almost
only done in `__call__`, which is not meant to be overriden.
- The methods do not receive`null` as a `DataArrayResample` object
anymore, but as a normal `DataArray`. This allows a bit more
flexibility, which I use to optimise `MissingWMO` by using
`resample_map` on the `longest_run` condition. Benchmarking to come.
- New `MissingTwoSteps` subclass used by `MissingPct` and
`AtLeastNValid` (and `MissingWMO`, but not in a new way). This adds a
`subfreq` option which can be... (continued)
Source Files on build 13270676869
Detailed source file information is not available for this build.
  • Back to Repo
  • f08b13e6 on github
  • Prev Build on main (#13268436651)
  • Next Build on main (#13294978065)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc