Skip to content

Commit

Permalink
use endswith instead of numerical indexing
Browse files Browse the repository at this point in the history
Co-authored-by: Wei Ji <[email protected]>
  • Loading branch information
JessicaS11 and weiji14 authored Mar 16, 2022
1 parent cf1fcfe commit 35435d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icepyx/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _add_var_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict):
try:
if (
hasattr(is2ds, "data_start_utc")
and is2ds["data_start_utc"].data[0].astype(str)[:-1] == "Z"
and is2ds["data_start_utc"].data[0].astype(str).endswith("Z")
):
# manually remove 'Z' from datetime to allow conversion to np.datetime64 object (support for timezones is deprecated and causes a seg fault)
is2ds["data_start_utc"] = np.datetime64(
Expand Down

0 comments on commit 35435d1

Please sign in to comment.