From 0b5459b2fd6d4f48ccfcc1cd6cba900b45564861 Mon Sep 17 00:00:00 2001 From: golmschenk Date: Tue, 6 Feb 2024 14:55:42 -0800 Subject: [PATCH] Remove support for Python 3.8 --- pyproject.toml | 2 +- src/qusi/toy_light_curve_collection.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 553fabc2..af17f060 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ cov = [ ] [[tool.hatch.envs.all.matrix]] -python = ["3.8", "3.9", "3.10", "3.11", "3.12"] +python = ["3.9", "3.10", "3.11", "3.12"] [tool.hatch.envs.types] dependencies = [ diff --git a/src/qusi/toy_light_curve_collection.py b/src/qusi/toy_light_curve_collection.py index cf1ca4cf..adc24215 100644 --- a/src/qusi/toy_light_curve_collection.py +++ b/src/qusi/toy_light_curve_collection.py @@ -1,5 +1,10 @@ from pathlib import Path +try: + from typing import List +except ImportError: + from typing_extensions import List + import numpy as np from qusi.light_curve import LightCurve @@ -15,6 +20,8 @@ class ToyLightCurve: def flat(cls, value: float = 1) -> LightCurve: """ Creates a flat light curve. + + :param value: The flux value of the flat light curve. """ length = 100 fluxes = np.full(shape=[length], fill_value=value, dtype=np.float32) @@ -33,14 +40,25 @@ def sine_wave(cls, period=50) -> LightCurve: return LightCurve.new(times=times, fluxes=fluxes) -def toy_light_curve_get_paths_function(): +def toy_light_curve_get_paths_function() -> List[Path]: + """ + A fake function to fulfill the need of returning a list of paths. + """ return [Path('')] -def toy_flat_light_curve_load_times_and_fluxes(path: Path) -> (np.ndarray, np.ndarray): + +def toy_flat_light_curve_load_times_and_fluxes(_path: Path) -> (np.ndarray, np.ndarray): + """ + Loads a flat toy light curve. + """ light_curve = ToyLightCurve.flat() return light_curve.times, light_curve.fluxes -def toy_sine_wave_light_curve_load_times_and_fluxes(path: Path) -> (np.ndarray, np.ndarray): + +def toy_sine_wave_light_curve_load_times_and_fluxes(_path: Path) -> (np.ndarray, np.ndarray): + """ + Loads a sine wave toy light curve. + """ light_curve = ToyLightCurve.sine_wave() return light_curve.times, light_curve.fluxes