Skip to content

Commit

Permalink
update to fix pylint flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Jun 20, 2024
1 parent 6f85237 commit 93432d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import json
import operator
import os
import re
from itertools import zip_longest
from typing import List, Optional, Tuple, Union
import dateutil
Expand All @@ -40,7 +41,6 @@
import xarray.coding.times
from shapely.geometry import Point, Polygon, MultiPolygon
from shapely.ops import transform
import re

from podaac.subsetter import gpm_cleanup as gc
from podaac.subsetter import time_converting as tc
Expand Down Expand Up @@ -546,12 +546,12 @@ def compute_time_variable_name(dataset: xr.Dataset, lat_var: xr.Variable, total_
time_units_pattern = re.compile(r"(days|d|hours|hr|h|minutes|min|m|seconds|sec|s) since \d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?")
# Check variables for common time variable indicators
for var_name, var in dataset.variables.items():
if ((('standard_name' in var.attrs and var.attrs['standard_name'] == 'time') or \
('axis' in var.attrs and var.attrs['axis'] == 'T') or \
('units' in var.attrs and time_units_pattern.match(var.attrs['units'])))) and var_name not in var_name not in total_time_vars:
print(var_name)
# pylint: disable=too-many-boolean-expressions
if ((('standard_name' in var.attrs and var.attrs['standard_name'] == 'time') or
('axis' in var.attrs and var.attrs['axis'] == 'T') or
('units' in var.attrs and time_units_pattern.match(var.attrs['units'])))) and var_name not in total_time_vars:
return var_name

# then check if any variables have 'time' in the string if the above loop doesn't return anything
for var_name in list(dataset.data_vars.keys()):
var_name_time = var_name.strip(GROUP_DELIM).split(GROUP_DELIM)[-1]
Expand Down

0 comments on commit 93432d4

Please sign in to comment.