Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1327

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: mixed-line-ending
args: ['--fix=no']
- repo: https://github.com/pycqa/flake8
rev: '6.0.0'
rev: '6.1.0'
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
]

# set this to properly handle multiple input params with the same type/shape
Expand Down Expand Up @@ -154,9 +155,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# html_theme = 'alabaster'
html_theme = "default"
html_theme_options = {"rightsidebar": "false", "relbarbgcolor": "black"}
html_theme = "sphinx_rtd_theme"


# Theme options are theme-specific and customize the look and feel of a theme
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx>=1.3
sphinx_rtd_theme==0.5.2
sphinx>=6.2
sphinx_rtd_theme==1.2.2
4 changes: 2 additions & 2 deletions pyuvdata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5061,13 +5061,13 @@ def parse_ants(uv, ant_str, print_toggle=False, x_orientation=None):

for ant_i in ant_i_list:
include_i = True
if type(ant_i) == str and ant_i.startswith("-"):
if isinstance(ant_i, str) and ant_i.startswith("-"):
ant_i = ant_i[1:] # nibble the - off the string
include_i = False

for ant_j in ant_j_list:
include_j = True
if type(ant_j) == str and ant_j.startswith("-"):
if isinstance(ant_j, str) and ant_j.startswith("-"):
ant_j = ant_j[1:]
include_j = False

Expand Down
8 changes: 4 additions & 4 deletions pyuvdata/uvdata/aipy_extracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def parse_ants(ant_str, nants):
ajs = m[6].split(",")

for i in ais:
if type(i) == str and i.startswith("-"):
if isinstance(i, str) and i.startswith("-"):
i = i[1:] # nibble the - off the string
include_i = 0
else:
Expand All @@ -164,7 +164,7 @@ def parse_ants(ant_str, nants):
for j in ajs:
include = None

if type(j) == str and j.startswith("-"):
if isinstance(j, str) and j.startswith("-"):
j = j[1:]
include_j = 0
else:
Expand Down Expand Up @@ -217,7 +217,7 @@ def uv_selector(uv, ants=-1, pol_str=-1):
None
"""
if ants != -1:
if type(ants) == str:
if isinstance(ants, str):
ants = parse_ants(ants, uv["nants"])

for cnt, (bl, include, pol) in enumerate(ants):
Expand Down Expand Up @@ -421,7 +421,7 @@ def _rdhd(self, name):

if len(rv) == 1:
return rv[0]
elif type(rv) == str:
elif isinstance(rv, str):
return rv
else:
return np.array(rv)
Expand Down
8 changes: 4 additions & 4 deletions pyuvdata/uvdata/mir_meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def __add__(
If attempting to combine this object with another of a different type.
"""
# First up, make sure we have two objects of the same dtype
if type(self) != type(other):
if not isinstance(other, self.__class__):
raise ValueError("Both objects must be of the same type.")

if other._data is None:
Expand Down Expand Up @@ -1584,7 +1584,7 @@ def _generate_new_header_keys(self, other):
If the two objects are not of the same type.
"""
# First up, make sure we have two objects of the same dtype
if type(self) != type(other):
if not isinstance(other, self.__class__):
raise ValueError("Both objects must be of the same type.")

# If no data are loaded, or if there is no header key, then this is basically
Expand Down Expand Up @@ -1917,7 +1917,7 @@ def _add_check(self, other, merge=None, overwrite=None, discard_flagged=False):
but the header keys (and their respective index positions) are different.
"""
# First up, make sure we have two objects of the same dtype
if type(self) != type(other):
if not isinstance(other, self.__class__):
raise ValueError("Both objects must be of the same type.")

if merge and discard_flagged:
Expand Down Expand Up @@ -2927,7 +2927,7 @@ def _generate_new_header_keys(self, other):
If the two objects are not of the same type.
"""
# First up, make sure we have two objects of the same dtype
if type(self) != type(other):
if not isinstance(other, self.__class__):
raise ValueError("Both objects must be of the same type.")

index_dict = {}
Expand Down
6 changes: 3 additions & 3 deletions pyuvdata/uvdata/miriad.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def _read_miriad_metadata(self, uv, correct_lat_lon=True):

# keep all single valued extra_variables as extra_keywords
for key in check_variables.keys():
if type(check_variables[key]) == str:
if isinstance(check_variables[key], str):
value = check_variables[key].replace("\x00", "")
# check for booleans encoded as strings
if value == "True":
Expand All @@ -690,7 +690,7 @@ def _read_miriad_metadata(self, uv, correct_lat_lon=True):
key not in ["vartable", "history", "obstype"]
and key not in other_miriad_variables
):
if type(uv[key]) == str:
if isinstance(uv[key], str):
value = uv[key].replace("\x00", "")
value = uv[key].replace("\x01", "")
if value == "True":
Expand Down Expand Up @@ -1988,7 +1988,7 @@ def write_miriad(
value = float(value)
elif issubclass(value.dtype.type, np.complexfloating):
raise_type_error = True
elif type(value) == bool:
elif isinstance(value, bool):
value = str(value)
elif type(value) not in types.keys():
raise_type_error = True
Expand Down