Closed coxipi closed 10 months ago
The problem is the missing activity
(https://github.com/Ouranosinc/xscen/blob/26387231ddce8ccfacd059d193f0c3de932f9ea8/xscen/extract.py#L1240). The code assumes that you are passing an official catalog with all the right columns (withhistorical
in activity CMIP
and sspXYZ
, in ScenarioMIP
).
Maybe we could throw a warning if necessary columns are not filled?
I see. I had the impression that the "experiment" column would be used in this way. I think a warning would be good maybe yes, because I would characterize this as a silent failure otherwise. Then again, if my use case is just not the intended way to work with these tools, feel free to ignore this issue.
Both colums are used (activity and experiment). I can do a PR to add a warning. I don't think passing your own catalog is the "wrong" way to use this, even if it is not the typical case. Though, in general, I would encourage you to fill in as many columns as you can when creating your own catalogue https://xscen.readthedocs.io/en/latest/columns.html
I can't remember the reason we explicitly skip np.NaN as the activity
. I guess HighResMIP is skipped because such an SSP wouldn't be compatible with a CMIP hist, but why skip NaN ?
I don't remember either...
Setup Information
Description
I parse a local directory to create a
df
. The following fields:are unspecified, which causes the historical period to disappear when I proceed to make a catalog that matches
hist
andfut
.Steps To Reproduce
The elements in
ds_dict
only contain the historical period when I fill the fields specified above. Otherwise, the historical period is ignored.If I remove
match_hist_and_fut=True
, the historical periods remain, and they're separated. I checked and bothsspXYZ
andhistorical
have[None,None,None]
for the 3 specified fields, so it doesn't seem to be because of mismatching fields, but really the presence ofNone
rather than some random string that makes the difference.Additional context
No response
Contribution