diff --git a/astronify/simulator/sim_lc.py b/astronify/simulator/sim_lc.py index 83c0655..a798ace 100644 --- a/astronify/simulator/sim_lc.py +++ b/astronify/simulator/sim_lc.py @@ -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( diff --git a/astronify/utils/tests/test_pitch_mapping.py b/astronify/utils/tests/test_pitch_mapping.py index 0315491..95b953e 100644 --- a/astronify/utils/tests/test_pitch_mapping.py +++ b/astronify/utils/tests/test_pitch_mapping.py @@ -20,7 +20,7 @@ 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 @@ -28,7 +28,7 @@ def test_data_to_pitch(): 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() @@ -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 @@ -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]) @@ -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 @@ -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 @@ -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 @@ -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() @@ -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() diff --git a/docs/conf.py b/docs/conf.py index b73c32c..5f9d614 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 @@ -114,6 +113,7 @@ def setup_style(app): app.add_stylesheet("astronify.css") + master_doc = "contents" html_extra_path = ["index.html", "CreateWithLight.html"] @@ -152,7 +152,7 @@ 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") ] @@ -160,9 +160,7 @@ def setup_style(app): # 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 --------------------------------- diff --git a/setup.py b/setup.py index b0c4979..40b1e12 100755 --- a/setup.py +++ b/setup.py @@ -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, } )