-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed AttributeError: 'datetime.datetime' object has no attribute '_t…
…o_real_datetime'
- Loading branch information
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d45c93f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually handles the case that the data is loaded from an existing netCDF format track file.
The
datetime
in a netcdf is actually of typenetcdftime._datetime.datetime
, which is different from the standarddatetime.datetime
type. (for example, https://ocefpaf.github.io/python4oceanographers/blog/2015/08/10/cf_units_and_time/ shows this issue).We should have a better solution - probably modify
Utilities.track.ncReadTrackData
to handle the _to_real_datetime conversion.