diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 78e739a..0000000 --- a/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -source = - tid -[report] -omit = - */python?.?/* - */site-packages/nose/* - # ignore _version.py and versioneer.py - .*version.* - *_version.py - -exclude_lines = - if __name__ == '__main__': diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b9913a5..2d6eb6d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install system-deps (for pycurl) - run: sudo apt-get install libcurl4-gnutls-dev libgnutls28-dev + run: sudo apt-get install -y libcurl4-openssl-dev libgeos-dev - name: Install Python packgaes run: | # These packages are installed in the base environment but may be older @@ -33,4 +33,4 @@ jobs: - name: Test with pytest run: | coverage run -m pytest -vv - coverage report -m + coverage report -m \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7efb37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.9 + +# Java needed for Spark API +RUN apt-get update -y \ + && apt-get install -y libcurl4-openssl-dev libgeos-dev + +WORKDIR /tmp + +COPY requirements-dev.txt . +COPY tid tid/ +COPY .codecov.yml . +COPY pyproject.toml . + +# Install python dependencies +RUN pip install -r requirements-dev.txt + +ENTRYPOINT coverage run -m pytest -vv diff --git a/README.md b/README.md index 7dfe615..d18de55 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,16 @@ This library is designed to look for traveling ionospheric disturbances This branch is in a "being rewritten" state. +## Setup +Some platform-specific dependencies must be installed first: +### Ubuntu (20.04) +`sudo apt install gcc g++ libcurl4-dev libgeos-dev proj-bin` +### MacOS +`brew install proj` +Following this, you should be able to install the requirements with + +`python -m pip install -r requirements.txt` ## Contributing Please ensure pylint and mypy are happy before pushing code. diff --git a/pyproject.toml b/pyproject.toml index c6d9f9e..60cbec6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,47 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "tid" +version = "0.1.0" +description = "Ionospheric measurements from GPS to detect launches." +authors = [ + {name = "Tyler Nighswander"}, + {name = "Michael Nute"} +] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Natural Language :: English", + "Programming Language :: Python :: 3", +] +license = {file = "LICENSE"} +readme = "README.md" +requires-python = ">=3.8" +dependencies = [ + "atomicwrites", + "awkward", + "cartopy", + "georinex", + "hatanaka", + "h5py", + "laika@git+https://github.com/commaai/laika#egg=laika", + "matplotlib", + "numpy", + "pyyaml", + "ruptures", + "scipy", + "sympy", + "xarray" +] + +[project.urls] +repository = "https://github.com/tylerni7/missile-tid" + +[tool.setuptools.packages.find] +exclude = ["docs", "tests"] +namespaces = false # true by default + [tool.mypy] python_version = "3.8" @@ -23,12 +67,27 @@ ignore_missing_imports = true [tool.pylint.'MESSAGES CONTROL'] max-line-length = 100 -max-attributes=12 -max-args=10 -max-locals=20 -min-public-methods=0 +max-attributes = 12 +max-args = 10 +max-locals = 20 +min-public-methods = 0 # accepted short names: i,j,k for iteration # t for time # f1,f2 for frequencies -good-names=['i,j,k,t,f1,f2'] -ignore=["tests"] +good-names = ["i,j,k,t,f1,f2"] +ignore = ["tests"] + +[tool.coverage.run] +source = ["tid"] + +[tool.coverage.report] +omit = [ + "*/python?.?/*", + "*/site-packages/nose/*", + # ignore _version.py and versioneer.py + ".*version.*", + "*_version.py" +] +exclude_lines = [ + "if __name__ == '__main__':" +] \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b54a37..305531b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,14 +1,59 @@ -# These are required for developing the package (running the tests, building -# the documentation) but not necessarily required for _using_ it. -codecov -coverage -flake8 -pytest -sphinx -twine -# These are dependencies of various sphinx extensions for documentation. -ipython -matplotlib -numpydoc -sphinx-copybutton -sphinx_rtd_theme +atomicwrites==1.4.1 +attrs==22.2.0 +awkward==2.0.4 +awkward-cpp==5 +black==22.12.0 +Cartopy==0.21.1 +certifi==2022.12.7 +charset-normalizer==2.1.1 +click==8.1.3 +contourpy==1.0.6 +coverage==7.0.1 +cycler==0.11.0 +exceptiongroup==1.1.0 +flake8==6.0.0 +fonttools==4.38.0 +georinex==1.16.1 +h5py==3.7.0 +hatanaka==2.8.0 +idna==3.4 +importlib-resources==5.10.1 +iniconfig==1.1.1 +kiwisolver==1.4.4 +laika @ git+https://github.com/commaai/laika@5eb0c3c2596dd12a232b83bdb057a716810e89cf +matplotlib==3.6.2 +mccabe==0.7.0 +mpmath==1.2.1 +mypy==0.991 +mypy-extensions==0.4.3 +ncompress==1.0.0 +numpy==1.24.1 +packaging==22.0 +pandas==1.5.2 +pathspec==0.10.3 +Pillow==9.3.0 +platformdirs==2.6.0 +pluggy==1.0.0 +pycodestyle==2.10.0 +pycurl==7.45.2 +pyflakes==3.0.1 +pyparsing==3.0.9 +pyproj==3.4.1 +pyshp==2.3.1 +pytest==7.2.0 +python-dateutil==2.8.2 +pytz==2022.7 +PyYAML==6.0 +requests==2.28.1 +scipy==1.9.3 +setuptools-scm==7.1.0 +Shapely==1.8.4 +six==1.16.0 +sympy==1.11.1 +tomli==2.0.1 +tqdm==4.64.1 +typing_extensions==4.4.0 +unlzw3==0.2.1 +urllib3==1.26.13 +xarray==2022.12.0 +zipp==3.11.0 diff --git a/requirements.txt b/requirements.txt index 79227fa..66d86a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,43 @@ -# List required packages in this file, one per line. - -georinex -h5py -laika @ git+https://github.com/commaai/laika#egg=laika -matplotlib -numpy -ruptures -scipy +atomicwrites==1.4.1 +awkward==2.0.4 +awkward-cpp==5 +Cartopy==0.21.1 +certifi==2022.12.7 +charset-normalizer==2.1.1 +contourpy==1.0.6 +cycler==0.11.0 +fonttools==4.38.0 +georinex==1.16.1 +h5py==3.7.0 +hatanaka==2.8.0 +idna==3.4 +importlib-resources==5.10.1 +kiwisolver==1.4.4 +laika @ git+https://github.com/commaai/laika@5eb0c3c2596dd12a232b83bdb057a716810e89cf +matplotlib==3.6.2 +mpmath==1.2.1 +ncompress==1.0.0 +numpy==1.24.1 +packaging==22.0 +pandas==1.5.2 +Pillow==9.3.0 +pycurl==7.45.2 +pyparsing==3.0.9 +pyproj==3.4.1 +pyshp==2.3.1 +python-dateutil==2.8.2 +pytz==2022.7 +PyYAML==6.0 +requests==2.28.1 +scipy==1.9.3 +setuptools-scm==7.1.0 +Shapely==1.8.4 +six==1.16.0 +sympy==1.11.1 +tomli==2.0.1 +tqdm==4.64.1 +typing_extensions==4.4.0 +unlzw3==0.2.1 +urllib3==1.26.13 +xarray==2022.12.0 +zipp==3.11.0 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 66aa752..0000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -from os import path -from setuptools import setup, find_packages -import sys - - -# NOTE: This file must remain Python 2 compatible for the foreseeable future, -# to ensure that we error out properly for people with outdated setuptools -# and/or pip. -min_version = ( - 3, - 8, -) -if sys.version_info < min_version: - error = """ -tid does not support Python {0}.{1}. -Python {2}.{3} and above is required. Check your Python version like so: - -python3 --version - -This may be due to an out-of-date pip. Make sure you have pip >= 9.0.1. -Upgrade pip like so: - -pip install --upgrade pip -""".format( - *(sys.version_info[:2] + min_version) - ) - sys.exit(error) - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, "README.rst"), encoding="utf-8") as readme_file: - readme = readme_file.read() - -with open(path.join(here, "requirements.txt")) as requirements_file: - # Parse requirements.txt, ignoring any commented-out lines. - requirements = [ - line - for line in requirements_file.read().splitlines() - if not line.startswith("#") - ] - - -setup( - name="tid", - version="0.1", - description="Ionospheric measurements from GPS to detect launches.", - long_description=readme, - author="Tyler Nighswander, Michael Nute", - url="https://github.com/tylerni7/missile-tid", - python_requires=">={}".format(".".join(str(n) for n in min_version)), - packages=find_packages(exclude=["docs", "tests"]), - entry_points={ - "console_scripts": [ - # 'command = some.module:some_function', - ], - }, - include_package_data=True, - package_data={ - "tid": [ - # When adding files here, remember to update MANIFEST.in as well, - # or else they will not be included in the distribution on PyPI! - # 'path/to/data_file', - ] - }, - install_requires=requirements, - license="BSD (3-clause)", - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Natural Language :: English", - "Programming Language :: Python :: 3", - ], -)