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

Ouranosinc / xclim / 37836229173
91%

Build:
DEFAULT BRANCH: main
Ran 08 Oct 2026 08:04PM 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
37836229173

push

github

web-flow
Special path for deep-copying indicators (#2445)

<!--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:
- [ ] This PR addresses an already opened issue (for bug fixes /
features)
    - This PR fixes #xyz
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [ ] CHANGELOG.rst has been updated (with summary of main changes)
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added

This fixes an issue raised by @juliettelavoie in xscen, and should fix
an issue seen by @coxipi (raised in slack) that I first thought was
related to #2443 .

### What kind of change does this PR introduce?

* With the changes in v1, calling `Indicator.__new__` would always
return a new class, with a new name, whereas this was not the case in
v0.
* Making identifier optional but register defaulting to True means that
a normal class creation call (`__new__`) _requires_ at least one them
being given, an empty call would raise an error.
* Python's process for `copy` and `deepcopy` goes through calling
`__new__` with no arguments, unless the class has `__deepcopy__`
implemented.

Implementing a `__deepcopy__` seemed too complicated / laborious so I
opted here for a "fast-track" in indicator creation that returns the
same class if `__new__` is called with no arguments. Note that this does
not mean "no changed argument", it means literally _no_ argument. To
"overwrite" an existing indicator, simply pass the same `identifier`.

In v0, `identifier` defaulted to the base class's, which meant
"overwriting" by default, but this seems like it was rarely an issue, if
at all.

### Does this PR introduce a breaking change?
No.

### Other information:
I did not change the way `Indicator.copy()` works, so the user-facing
function still ... (continued)
Source Files on build 37836229173
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #37836229173
  • 1234b9ee on github
  • Prev Build on main (#37483836795)
  • Next Build on main (#37938234144)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc