diff --git a/cs_util/__init__.py b/cs_util/__init__.py index 287b47c..7d84992 100644 --- a/cs_util/__init__.py +++ b/cs_util/__init__.py @@ -35,5 +35,3 @@ 'Could not extract package metadata. Make sure the package is ' + 'correctly installed.', ) - -__version__ = _version diff --git a/cs_util/example/math.py b/cs_util/example/math.py index 496a4c6..315f9c2 100644 --- a/cs_util/example/math.py +++ b/cs_util/example/math.py @@ -162,3 +162,35 @@ def mad(input_data: np.ndarray) -> float: """ return np.median(np.abs(input_data - np.median(input_data))) + + +def add_two_floats(first_value: float, second_value: float) -> float: + """Add Two Floats. + + Add two float values. + + Parameters + ---------- + first_value : float + First float value + second_value : float + Second float value + + Returns + ------- + float + Result of addition + + Raises + ------ + TypeError + For invalid input types. + + """ + fv_is_float = isinstance(first_value, float) + sv_is_float = isinstance(second_value, float) + + if not all((fv_is_float, sv_is_float)): + raise TypeError('Inputs must be floats.') + + return first_value + second_value diff --git a/develop.txt b/develop.txt index 8a28821..592123c 100644 --- a/develop.txt +++ b/develop.txt @@ -1,8 +1,8 @@ -coverage==5.3 -nose==1.3.7 -pytest==6.1.2 -pytest-cov==2.10.1 -pytest-pep8==1.0.6 -pytest-emoji==0.2.0 -pytest-flake8==1.0.6 -wemake-python-styleguide==0.14.1 +coverage +nose +pytest +pytest-cov +pytest-pep8 +pytest-emoji +pytest-flake8 +wemake-python-styleguide diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..67c55f2 --- /dev/null +++ b/environment.yml @@ -0,0 +1,8 @@ +name: cs_util +channels: + - conda-forge +dependencies: + - python==3.10 + - pip>=21 + - pip: + - -r requirements.txt diff --git a/requirements.txt b/requirements.txt index a00d712..90a862b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ -importlib_metadata==3.1.1 +importlib_metadata numpy astropy matplotlib +pycodestyle==2.9.0 vos datetime diff --git a/setup.py b/setup.py index 9dbbd7b..c3635e6 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ license = 'MIT' # Set the package classifiers -python_versions_supported = ['3.6', '3.7', '3.8', '3.9'] +python_versions_supported = ['3.6', '3.7', '3.8', '3.9', '3.10'] os_platforms_supported = ['Unix', 'MacOS'] lc_str = 'License :: OSI Approved :: {0} License'