Skip to content

Commit

Permalink
almost last round of lynting
Browse files Browse the repository at this point in the history
  • Loading branch information
scfleming committed Jan 16, 2025
1 parent 00c0f72 commit e39226e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
6 changes: 5 additions & 1 deletion astronify/simulator/sim_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ def simulated_lc(
# Record the flare parameters used if adding a flare.
if lc_type == "flare":
hdr.append(
("FLARETIM", flare_time, "Index corresponding to the peak of the flare.")
(
"FLARETIM",
flare_time,
"Index corresponding to the peak of the flare.",
)
)
hdr.append(("FLAREAMP", flare_amp, "Amplitude of the flare."))
hdr.append(
Expand Down
20 changes: 11 additions & 9 deletions astronify/utils/tests/test_pitch_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def test_data_to_pitch():

assert (
pitch_arr
== data_to_pitch(data_arr, pitch_range, center_pitch, stretch='linear')
== data_to_pitch(data_arr, pitch_range, center_pitch, stretch="linear")
).all()

# invert
pitch_arr = pitch_range[1] - data_arr * (pitch_range[1] - pitch_range[0])
assert (
pitch_arr
== data_to_pitch(
data_arr, pitch_range, center_pitch, stretch='linear', invert=True
data_arr, pitch_range, center_pitch, stretch="linear", invert=True
)
).all()

Expand All @@ -41,7 +41,7 @@ def test_data_to_pitch():
) + pitch_range[0]
assert (
pitch_arr
== data_to_pitch(data_arr, pitch_range, center_pitch, stretch='linear')
== data_to_pitch(data_arr, pitch_range, center_pitch, stretch="linear")
).all()

# linear stretch with non-equal lower/upper pitch ranges
Expand All @@ -57,7 +57,7 @@ def test_data_to_pitch():
pitch_arr == data_to_pitch(data_arr, [400, 600], center_pitch, stretch="linear")
).all()
pitch_range = [400, 500]

# min_max val
minval, maxval = 0, 1
data_arr = np.array([1, 0, -1, 2])
Expand All @@ -66,7 +66,7 @@ def test_data_to_pitch():
pitch_range,
center_pitch,
stretch="linear",
minmax_value=[minval, maxval]
minmax_value=[minval, maxval],
)
data_arr[data_arr < minval] = minval
data_arr[data_arr > maxval] = maxval
Expand All @@ -80,7 +80,7 @@ def test_data_to_pitch():
pitch_range,
center_pitch,
stretch="linear",
minmax_value=[minval, maxval]
minmax_value=[minval, maxval],
)
data_arr[data_arr < minval] = minval
data_arr[data_arr > maxval] = maxval
Expand All @@ -94,7 +94,8 @@ def test_data_to_pitch():
)
assert (
np.isclose(
pitch_arr, np.array([500, 400, 500, 400, 422.22222222, 477.77777778]))
pitch_arr, np.array([500, 400, 500, 400, 422.22222222, 477.77777778])
)
).all()

# asinh
Expand Down Expand Up @@ -139,7 +140,8 @@ def test_data_to_pitch():
data_arr, pitch_range, center_pitch, zero_point, stretch="log"
)
manual_pitch_arr = (
np.log(1000 * data_arr + 1) / np.log(1001) * (pitch_range[1] - pitch_range[0]) + pitch_range[0]
np.log(1000 * data_arr + 1) / np.log(1001) * (pitch_range[1] - pitch_range[0])
+ pitch_range[0]
)
assert (manual_pitch_arr == pitch_arr).all()

Expand All @@ -160,6 +162,6 @@ def test_data_to_pitch():
center_pitch,
stretch="linear",
minmax_value=[0, 1],
minmax_percent=[20, 80]
minmax_percent=[20, 80],
)
assert (pitch_arr == test_arr).all()
10 changes: 4 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
# This does not *have* to match the package name, but typically does
project = setup_cfg["name"]
author = setup_cfg["author"]
copyright = "{0}, {1}".format(
datetime.datetime.now().year, setup_cfg["author"])
copyright = "{0}, {1}".format(datetime.datetime.now().year, setup_cfg["author"])

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -114,6 +113,7 @@
def setup_style(app):
app.add_stylesheet("astronify.css")


master_doc = "contents"
html_extra_path = ["index.html", "CreateWithLight.html"]

Expand Down Expand Up @@ -152,17 +152,15 @@ def setup_style(app):
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", project + ".tex", project + u" Documentation", author, "manual")
("index", project + ".tex", project + " Documentation", author, "manual")
]


# -- Options for manual page output -------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", project.lower(), project + u" Documentation", [author], 1)
]
man_pages = [("index", project.lower(), project + " Documentation", [author], 1)]


# -- Options for the edit_on_github extension ---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@
setup(
use_scm_version={
"write_to": os.path.join("astronify", "version.py"),
"write_to_template": VERSION_TEMPLATE
"write_to_template": VERSION_TEMPLATE,
}
)

0 comments on commit e39226e

Please sign in to comment.