-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
New: IssueHighlight a new community raised "generic" issueHighlight a new community raised "generic" issueType: Bug
Description
This block:
Lines 1731 to 1744 in 23bd604
| # Use cftime for converting reference times that are not using a | |
| # gregorian calendar as it handles these and udunits does not. | |
| if self.is_time_reference() and self.calendar != CALENDAR_STANDARD: | |
| result_datetimes = cftime.num2date( | |
| result, self.cftime_unit, self.calendar | |
| ) | |
| result = cftime.date2num( | |
| result_datetimes, other.cftime_unit, other.calendar | |
| ) | |
| convert_type = isinstance(value, np.ndarray) and np.issubdtype( | |
| value.dtype, np.floating | |
| ) | |
| if convert_type: | |
| result = result.astype(value.dtype) |
... will never be entered because it is hidden behind this check:
Line 1726 in 23bd604
| if self.is_convertible(other): |
Lines 998 to 1002 in 23bd604
| else: | |
| result = self.calendar == other.calendar and _ud.are_convertible( | |
| self.ut_unit, other.ut_unit | |
| ) | |
| return result |
This may be inconsequential given these docs, but in either case this block should presumably be removed?
Lines 1709 to 1718 in 23bd604
| .. note:: | |
| Conversion between unit calendars is not permitted unless the | |
| calendars are aliases, see :attr:`cf_units.CALENDAR_ALIASES`. | |
| >>> from cf_units import Unit | |
| >>> a = Unit('days since 1850-1-1', calendar='gregorian') | |
| >>> b = Unit('days since 1851-1-1', calendar='standard') | |
| >>> a.convert(365.75, b) | |
| 0.75 |
Metadata
Metadata
Assignees
Labels
New: IssueHighlight a new community raised "generic" issueHighlight a new community raised "generic" issueType: Bug
Type
Projects
Status
No status