Skip to content
Open
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 @@ -18,7 +18,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.20"
rev: "v0.16.1"
hooks:
- id: ruff-format
- id: ruff-check
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"name": "Radionets Project",
"url": "https://github.com/radionets-project",
"type": "url",
"icon": "https://avatars.githubusercontent.com/u/77392854?s=200&v=4", # noqa: E501
"icon": "https://avatars.githubusercontent.com/u/77392854?s=200&v=4",
},
],
"logo": {
Expand Down
2 changes: 1 addition & 1 deletion src/radiotools/fiducial/fiducial.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import warnings
from pathlib import Path

import astropy.units as units
import matplotlib
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from astropy import units
from astropy.constants import c
from astropy.io import fits
from astropy.io.fits import PrimaryHDU
Expand Down
10 changes: 5 additions & 5 deletions src/radiotools/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _info_version():

print("\n*** radiotools version info ***\n")
print(f"version: {radiotools.__version__}")
print("")
print()


def _info_dependencies():
Expand All @@ -68,7 +68,7 @@ def _info_dependencies():

for dep in deps:
req = Requirement(dep)
print(f"{req.name:>20} -- {str(req.specifier)}")
print(f"{req.name:>20} -- {req.specifier!s}")


def _info_tools():
Expand All @@ -77,7 +77,7 @@ def _info_tools():
# https://github.com/cta-observatory/ctapipe/blob/main/src/ctapipe/tools/info.py
print("\n*** radiotools cli-tools ***\n")
print("The following can be executed by typing radiotools-<toolname>:")
print("")
print()
tools = {
ep.name: ep.value
for ep in distribution("radiotools").entry_points
Expand All @@ -103,8 +103,8 @@ def _info_tools():
for name, descr in sorted(description.items()):
text = f"{name:<30s} -- {descr}"
print(wrapper.fill(text))
print("")
print("")
print()
print()


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions src/radiotools/layouts/layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def save(self, path, fmt="pyvisgen", overwrite=False, rel_to_site=None):
"station_name X Y Z dish_dia el_low el_high SEFD altitude\n"
)

for i in range(0, len(self.x)):
for i in range(len(self.x)):
row = map(
str,
[
Expand All @@ -455,7 +455,7 @@ def save(self, path, fmt="pyvisgen", overwrite=False, rel_to_site=None):

data.append("# X Y Z dish_dia station_name\n")

for i in range(0, len(self.x)):
for i in range(len(self.x)):
row = map(
str,
[
Expand Down Expand Up @@ -935,7 +935,7 @@ def geocentric2geodetic(x, y, z):
alt = alt.value
else:
lon, lat, alt = np.array([]), np.array([]), np.array([])
for i in range(0, len(x)):
for i in range(len(x)):
loc = EarthLocation.from_geocentric(x[i], y[i], z[i], "m")
lon = np.append(lon, loc.lon.deg)
lat = np.append(lat, loc.lon.deg)
Expand Down Expand Up @@ -967,7 +967,7 @@ def geodetic2geocentric(lon, lat, alt):
z = z.value
else:
x, y, z = np.array([]), np.array([]), np.array([])
for i in range(0, len(lon)):
for i in range(len(lon)):
loc = EarthLocation.from_geodetic(lon=lon[i], lat=lat[i], height=alt[i])
x = np.append(x, loc.x.value)
y = np.append(y, loc.y.value)
Expand Down
4 changes: 2 additions & 2 deletions src/radiotools/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .utils import beam2pix, get_array_names, pix2beam, rms, rmtree, uvfits2ms

__all__ = [
"get_array_names",
"beam2pix",
"get_array_names",
"pix2beam",
"rms",
"uvfits2ms",
"rmtree",
"uvfits2ms",
]
6 changes: 3 additions & 3 deletions src/radiotools/visibility/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def _time_delta(self, r1, r2):
return max(0, delta)

def get_optimal_date(self, print_result: bool = False) -> list:
"""Computes the best date to observe the target source.
r"""Computes the best date to observe the target source.
Returns a list of three :class:`~pandas.Timestamp` where the
first and last are the best date :math:`\pm` `obs_length / 2`.

Expand Down Expand Up @@ -470,7 +470,7 @@ def get_optimal_date(self, print_result: bool = False) -> list:
result = times[int(np.argmax(dt.sum(axis=0)))]

if print_result:
print("")
print()
tab = Table(title="*** Best observation time ***")
tab.add_column("Station ID", justify="right", style="cyan")
tab.add_column("Obs. time start")
Expand All @@ -485,6 +485,6 @@ def get_optimal_date(self, print_result: bool = False) -> list:
)
console = Console()
console.print(tab)
print("")
print()

return result
Loading