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

Ouranosinc / xscen / 25073828750 / 3
90%
main: 90%

Build:
DEFAULT BRANCH: main
Ran 28 Apr 2026 07:58PM UTC
Files 17
Run time 3s
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

28 Apr 2026 07:41PM UTC coverage: 79.938%. Remained the same
25073828750.3

push

github

web-flow
Drop nans before interpolating WL period (#722)

<!-- 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
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features).
- [ ] (If applicable) Tests have been added.
- [x] This PR does not seem to break the templates.
- [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?
It seems that `get_period_from_warming_level` can't handle timeseries
with nans at the beginning, scipy's interpolator returns the first value
when it is nan.

This fixes the issue by dropping any nans in the timeseries, letting the
interpolator work only on "known" data points.

I think we didn't see the issue before because it would only happen when
the beginning of a tas timeseries is missing, which only happens when a
window larger than 50 is requested (as we always have 1850-1900 for all
simulations).

Another way to do this would be `bfill('time')` as NaNs can only be
present at the beginning of the series. Both approach seem equivalent.

### Illustration of issue
```python3
xs.get_period_from_warming_level("CMIP6_NorESM2-MM_ssp126_r1i1p1f1", 0.69, window=55)
# ['1823', '1877']
```

```python3
ds = xr.open_dataset('/home/pbourg/Projets/xscen/src/xscen/data/IPCC_annual_global_tas.nc')

t = ds.tas.where((ds.experiment == 'ssp126') & (ds.source == 'NorESM2-MM'), drop=True).squeeze('simulation')
r = t.sel(time=slice('1850', '1900')).mean('time')

rd = (t - r).rolling(time=55, center=True, min_periods=55).mean().shift(time=1).cumulative('time').max()
```
Where "rd" is the rolling diff, the yearly max of warming level reached
by the model. For ... (continued)

3897 of 4875 relevant lines covered (79.94%)

0.8 hits per line

Source Files on job run-Python3.11-pypi-windows-latest - 25073828750.3
  • Tree
  • List 17
  • Changed 1
  • Source Changed 1
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25073828750
  • 5da87d22 on github
  • Prev Job for on main (#24753849216.5)
  • Next Job for on main (#25233485102.2)
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

© 2026 Coveralls, Inc