#66 enabled working dayofyr and dayofwk attributes for all cftime dates constructed manually, which is great!
I've noticed that if one constructs datetime objects using replace, that the dayofyr and dayofwk attributes are not automatically updated:
In [21]: date = cftime.DatetimeNoLeap(1, 2, 1)
In [22]: date.dayofyr
Out[22]: 32
In [23]: date.replace(year=2, month=5).dayofyr
Out[23]: 32
A workaround is to specify dayofwk=-1 within replace:
In [24]: date.replace(year=2, month=5, dayofwk=-1).dayofyr
Out[24]: 121
Is this intentional? Should we not pass down the old dayofyr and dayofwk attributes to the new date object in replace? I'm happy to provide a PR to change this behavior, if desired.
#66 enabled working
dayofyranddayofwkattributes for all cftime dates constructed manually, which is great!I've noticed that if one constructs datetime objects using
replace, that thedayofyranddayofwkattributes are not automatically updated:A workaround is to specify
dayofwk=-1withinreplace:Is this intentional? Should we not pass down the old
dayofyranddayofwkattributes to the new date object inreplace? I'm happy to provide a PR to change this behavior, if desired.