diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a7f6ad61..57640182 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,4 +26,4 @@ solve the problem. - Other details about your setup that could be relevant # Additional context -Add any other context about the problem here. +Add any other context about the problem here, including expected behaviour. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 20730861..da43edc7 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -15,5 +15,5 @@ the full context of your question. ## Configuration - OS: [e.g. Hal] - - Version [e.g. Python 3.47] + - Version: [e.g. Python 3.47] - Other details about your setup that could be relevant diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5fa8548d..24fa713d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ # Description -Addresses # (issue) +Addresses #(issue) Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required @@ -47,6 +47,7 @@ Test B - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules - [ ] Add a note to ``CHANGELOG.md``, summarizing the changes +- [ ] Update zenodo.json file for new code contributors If this is a release PR, replace the first item of the above checklist with the release checklist on the pysat wiki: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0c024531..ec7a09e8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,6 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# This workflow will install Python dependencies, run tests and lint with a +# variety of Python versions. For more information see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Documentation Check @@ -8,11 +9,11 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ["ubuntu-latest"] strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: ["3.9"] name: Documentation tests steps: @@ -21,11 +22,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r test_requirements.txt - pip install -r requirements.txt + - name: Install with dependencies + run: pip install .[doc] - name: Set up pysat run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58767c5f..07f4e21e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,17 +13,21 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.9", "3.10"] - numpy_ver: ["latest"] + python-version: ["3.10", "3.11"] + test_config: ["latest"] include: - - python-version: "3.8" + # NEP29 compliance settings + - python-version: "3.9" numpy_ver: "1.21" os: ubuntu-latest + test_config: "NEP29" + # Operational compliance settings - python-version: "3.6.8" numpy_ver: "1.19.5" os: "ubuntu-20.04" + test_config: "Ops" - name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }} + name: ${{ matrix.test_config }} Python ${{ matrix.python-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -32,15 +36,23 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install standard dependencies + - name: Install Operational dependencies + if: ${{ matrix.test_config == 'Ops'}} run: | + pip install numpy==${{ matrix.numpy_ver }} + pip install -r requirements.txt pip install -r test_requirements.txt - pip install -r requirements.txt; + pip install . - name: Install NEP29 dependencies - if: ${{ matrix.numpy_ver != 'latest'}} + if: ${{ matrix.test_config == 'NEP29'}} run: | pip install numpy==${{ matrix.numpy_ver }} + pip install --upgrade-strategy only-if-needed .[test] + + - name: Install standard dependencies + if: ${{ matrix.test_config == 'latest'}} + run: pip install .[test] - name: Set up pysat run: | @@ -54,7 +66,7 @@ jobs: run: flake8 . --count --exit-zero --max-complexity=10 --statistics - name: Test with pytest - run: pytest -x --cov=pysatMadrigal/ + run: pytest - name: Publish results to coveralls env: diff --git a/.github/workflows/pip_rc_install.yml b/.github/workflows/pip_rc_install.yml index 6b9d2d68..d9d3f413 100644 --- a/.github/workflows/pip_rc_install.yml +++ b/.github/workflows/pip_rc_install.yml @@ -1,6 +1,7 @@ -# This workflow will install Python dependencies and the latest RC of pysatNASA from test pypi. -# This test should be manually run before a pysatMadrigal RC is officially approved and versioned. -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# This workflow will install Python dependencies and the latest RC of +# pysatMadrigal from test pypi. This test should be manually run before an RC is +# officially approved and versioned. For more information see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Test install of latest RC from pip @@ -12,7 +13,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.10"] # Keep this version at the highest supported Python version + python-version: ["3.11"] # Keep this version at the highest supported Python version name: Python ${{ matrix.python-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/.github/workflows/pysat_rc.yml b/.github/workflows/pysat_rc.yml index 6d82336d..924ebbb5 100644 --- a/.github/workflows/pysat_rc.yml +++ b/.github/workflows/pysat_rc.yml @@ -1,5 +1,6 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# This workflow will install Python dependencies, run tests and lint with a +# variety of Python versions. For more information see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Test with latest pysat RC @@ -10,8 +11,7 @@ jobs: strategy: fail-fast: false matrix: -# TODO(#76): add windows tests when bugs are sorted - os: [ubuntu-latest, macos-latest] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] python-version: ["3.10"] name: Python ${{ matrix.python-version }} on ${{ matrix.os }} @@ -26,10 +26,8 @@ jobs: - name: Install pysat RC run: pip install --pre -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysat - - name: Install standard dependencies - run: | - pip install -r requirements.txt - pip install -r test_requirements.txt + - name: Install standard dependencies and package + run: run pip install .[test] - name: Set up pysat run: | @@ -37,7 +35,7 @@ jobs: python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'" - name: Test with pytest - run: pytest -vs -x --cov=pysatMadrigal/ + run: pytest - name: Publish results to coveralls env: diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..e1667025 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,25 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required version of readthedocs +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + + +# Declare the Python requirements required to build your docs +python: + install: + - method: pip + path: . + extra_requirements: + - doc diff --git a/CHANGELOG.md b/CHANGELOG.md index e6fd2d0c..66456a08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). * Add manual GitHub Actions tests for pysatMadrigal RC * Update GitHub Actions workflows for newer versions of pip * Added clean warning test attributes to all Instruments + * Updated documentation to comply with current Ecosystem guidelines + * Replaced setup.py with pyproject.toml [0.1.0] - 2023-04-11 -------------------- diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 483ea9ac..ee4a9e76 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -56,9 +56,9 @@ project may be further defined and clarified by project maintainers. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at pysat.developers@gmail.com. The -project team will review and investigate all complaints, and will respond in a -way that it deems appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an +pysatMadrigal project team will review and investigate all complaints, and will +respond in a way that it deems appropriate to the circumstances. The project +team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. @@ -69,7 +69,14 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.4, available at [https://contributor-covenant.org/version/1/4][version] +version 1.4, available at +[https://contributor-covenant.org/version/1/4][version] + +## FAQ + +For answers to common questions about this code of conduct, see +[https://www.contributor-covenant.org/faq][faq] [homepage]: https://contributor-covenant.org [version]: https://contributor-covenant.org/version/1/4/ +[faq]: https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a81865e6..956b6f84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,15 +5,21 @@ Bug reports, feature suggestions and other contributions are greatly appreciated! pysat and pysatMadrigal are community-driven projects that welcome both feedback and contributions. +Come join us on Slack! An invitation to the pysat workspace is available +in the 'About' section of the +[pysat GitHub Repository.](https://github.com/pysat/pysat) Development meetings +are generally held fortnightly. + Short version ------------- * Submit bug reports, feature requests, and questions at -`GitHub Issues `_ +[GitHub](https://github.com/pysat/pysatMadrigal/issues) + * Make pull requests to the ``develop`` branch -More about Issues ------------------ +Issues +------ Bug reports, questions, and feature requests should all be made as GitHub Issues. Templates are provided for each type of issue, to help you include @@ -24,73 +30,112 @@ Questions Not sure how something works? Ask away! The more information you provide, the easier the question will be to answer. You can also interact with the pysat -developers on our `slack channel `_. +developers on our [slack channel](https://pysat.slack.com). Bug reports ^^^^^^^^^^^ -When reporting a bug please include: +When [reporting a bug](https://github.com/pysat/pysatMadrigal/issues) please +include: * Your operating system name and version + * Any details about your local setup that might be helpful in troubleshooting + * Detailed steps to reproduce the bug -Feature requests -^^^^^^^^^^^^^^^^ +Feature requests and feedback +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The best way to send feedback is to file an +[issue](https://github.com/pysat/pysatMadrigal/issues). If you are proposing a new feature or a change in something that already exists: * Explain in detail how it would work. + * Keep the scope as narrow as possible, to make it easier to implement. + * Remember that this is a volunteer-driven project, and that code contributions are welcome :) -More about Development ----------------------- +Development +----------- To set up `pysatMadrigal` for local development: -1. Fork pysatMadrigal on - `GitHub `_. -2. Clone your fork locally:: +1. Fork [pysatMadrigal on GitHub](https://github.com/pysat/pysatMadrigal/fork). + +2. Clone your fork locally: + ``` git clone git@github.com:your_name_here/pysatMadrigal.git + ``` -3. Create a branch for local development:: +3. Create a branch for local development: + ``` git checkout -b name-of-your-bugfix-or-feature + ``` -4. Make your changes locally. Tests for new instruments are performed - automatically. Tests for custom functions should be added to the - appropriately named file in ``pysatMadrigal/tests``. For example, - Jicamarca methods containined in ``pysatMadrigal/instruments/methods/jro.py`` - should be named ``pysatMadrigal/tests/test_methods_jro.py``. If no test - file exists, then you should create one. This testing uses pytest, which - will run tests on any python file in the test directory that starts with - ``test``. Test classes must begin with ``Test``, and test methods must also - begin with ``test``. + Now you can make your changes locally. -5. When you're done making changes, run all the checks to ensure that nothing - is broken on your local system:: + Tests for new instruments are performed automatically. See discussion + [here](https://pysat.readthedocs.io/en/main/new_instrument.html#testing-support) + for more information on triggering these standard tests. - pytest -vs pysatMadrigal + Tests for custom functions should be added to the appropriately named file + in ``pysatMadrigal/tests``. For example, custom functions for the time + utilities are tested in ``pysat/tests/test_utils_time.py``. If no test file + exists, then you should create one. This testing uses pytest, which will run + tests on any python file in the test directory that starts with ``test``. + Classes must begin with ``Test``, and methods must begin with ``test`` as + well. + +4. When you're done making changes, run all the checks to ensure that nothing + is broken on your local system: + + ``` + pytest + + ``` + +5. You should also check for flake8 style compliance: + + ``` + flake8 . --count --select=D,E,F,H,W --show-source --statistics + ``` + + Note that pysat uses the `flake-docstrings` and `hacking` packages to ensure + standards in docstring formatting. 6. Update/add documentation (in ``docs``). Even if you don't think it's relevant, check to see if any existing examples have changed. 7. Add your name to the .zenodo.json file as an author -8. Commit your changes and push your branch to GitHub:: +8. Commit your changes: + ``` + git add . + git commit -m "AAA: Brief description of your changes" + ``` + Where AAA is a standard shorthand for the type of change (eg, BUG or DOC). + `pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html), + see the discussion there for a full list of this shorthand notation. - git add . - git commit -m "Brief description of your changes" - git push origin name-of-your-bugfix-or-feature +9. Once you are happy with the local changes, push to GitHub: + ``` + git push origin name-of-your-bugfix-or-feature + ``` + Note that each push will trigger the Continuous Integration workflow. + +10. Submit a pull request through the GitHub website. Pull requests should be + made to the ``develop`` branch. Note that automated tests will be run on + GitHub Actions, but these must be initialized by a member of the pysat team. -9. Submit a pull request through the GitHub website. Pull requests should be - made to the ``develop`` branch. Pull Request Guidelines -^^^^^^^^^^^^^^^^^^^^^^^ +----------------------- If you need some code review or feedback while you're developing the code, just make a pull request. Pull requests should be made to the ``develop`` branch. @@ -99,17 +144,18 @@ For merging, you should: 1. Include an example for use 2. Add a note to ``CHANGELOG.md`` about the changes -3. Ensure that all checks passed (current checks include Travis-CI - and Coveralls) [1]_ +3. Ensure that all checks passed (current checks include GitHub Actions and + Coveralls) + +If you don't have all the necessary Python versions available locally or have +trouble building all the testing environments, you can rely on GitHub Actions to +run the tests for each change you add in the pull request. Because testing here +will delay tests by other developers, please ensure that the code passes all +tests on your local system first. -.. [1] If you don't have all the necessary Python versions available locally or - have trouble building all the testing environments, you can rely on - Travis to run the tests for each change you add in the pull request. - Because testing here will delay tests by other developers, please ensure - that the code passes all tests on your local system first. Project Style Guidelines -^^^^^^^^^^^^^^^^^^^^^^^^ +------------------------ In general, pysat follows PEP8 and numpydoc guidelines. Pytest runs the unit and integration tests, flake8 checks for style, and sphinx-build performs @@ -130,15 +176,19 @@ These include: * `import numpy as np` * `import pandas as pds` * `import xarray as xr` +* When incrementing a timestamp, use `dt.timedelta` instead of `pds.DateOffset` + when possible to reduce program runtime * All classes should have `__repr__` and `__str__` functions * Docstrings use `Note` instead of `Notes` * Try to avoid creating a try/except statement where except passes -* Use setup and teardown in test classes +* Use setup_method (or setup_class) and teardown_method (or teardown_class) in + test classes * Use pytest parametrize in test classes when appropriate +* Use pysat testing utilities when appropriate * Provide testing class methods with informative failure statements and descriptive, one-line docstrings * Block and inline comments should use proper English grammar and punctuation with the exception of single sentences in a block, which may then omit the final period -* When casting is necessary, use `np.int64` and `np.float64` to ensure operating - system agnosticism +* When casting is necessary, use `np.int64` and `np.float64` to ensure operating + system agnosticism diff --git a/MANIFEST.in b/MANIFEST.in index d24537a0..6e2fb91c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,6 @@ recursive-include pysatMadrigal *.py include *.md include *.txt include LICENSE -include pysatMadrigal/version.txt prune pysatMadrigal/tests prune docs prune demo diff --git a/README.md b/README.md index 00b75996..0ae27baa 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ pysatMadrigal -# pysatMadrigal +# pysatMadrigal: pysat support for Madrigal data sets [![Documentation Status](https://readthedocs.org/projects/pysatmadrigal/badge/?version=latest)](https://pysatmadrigal.readthedocs.io/en/latest/?badge=latest) -[![Build Status](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)](https://github.com/github/docs/actions/workflows/main.yml/badge.svg) +[![Pytest with Flake8](https://github.com/pysat/pysatMadrigal/actions/workflows/main.yml/badge.svg)](https://github.com/pysat/pysatMadrigal/actions/workflows/main.yml) [![Coverage Status](https://coveralls.io/repos/github/pysat/pysatMadrigal/badge.svg?branch=main)](https://coveralls.io/github/pysat/pysatMadrigal?branch=main) [![DOI](https://zenodo.org/badge/258384773.svg)](https://zenodo.org/badge/latestdoi/258384773) [![PyPI version](https://badge.fury.io/py/pysatMadrigal.svg)](https://badge.fury.io/py/pysatMadrigal) @@ -27,7 +27,7 @@ for the Space Physics community. This module officially supports Python 3.7+. | Common modules | Community modules | | -------------- | ----------------- | | h5py | madrigalWeb>=2.6 | -| numpy | pysat >= 3.0.3 | +| numpy | pysat >= 3.1.0 | | pandas | | | xarray | | @@ -69,3 +69,6 @@ Afterward, pysat will identify them using the `platform` and `name` keywords. pysat.utils.registry.register('pysatMadrigal.instruments.dmsp_ivm') dst = pysat.Instrument('dmsp', 'ivm', tag='utd', inst_id='f15') ``` + +The package also include analysis tools. Detailed examples are in the +[documentation](https://pysatmadrigal.readthedocs.io/en/latest/?badge=latest). diff --git a/docs/conf.py b/docs/conf.py index a1063ec6..64aff85f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,9 @@ import json import os +from pyproject_parser import PyProject import sys + sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ @@ -55,20 +57,21 @@ master_doc = 'index' # General information about the project. +info = PyProject.load("../pyproject.toml") + project = 'pysatMadrigal' title = '{:s} Documentation'.format(project) zenodo = json.loads(open('../.zenodo.json').read()) author = ', '.join([creator['name'] for creator in zenodo['creators']]) description = ''.join(['Tools for accessing and analyzing data from the ', 'Madrigal database']) -copyright = ', '.join(['2021', author]) +category = 'Space Physics' +copyright = ', '.join(['2023', 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 # built documents. -doc_dir = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(doc_dir, "..", project, "version.txt"), "r") as fin: - version = fin.read().strip() +version = info.project['version'].base_version release = '{:s}-beta'.format(version) # Include alpha/beta/rc tags. # The language for content autogenerated by Sphinx. Refer to documentation @@ -76,7 +79,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -143,7 +146,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [(master_doc, project, title, author, project, - description, 'Space Physics')] + description, category)] # -- Options for Epub output ---------------------------------------------- diff --git a/docs/examples.rst b/docs/examples.rst index 8dfafff5..f1f482e0 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -7,4 +7,5 @@ tools .. toctree:: examples/ex_init.rst examples/ex_gnss_tec.rst - examples/ex_jro_isr_beam.rst \ No newline at end of file + examples/ex_jro_isr_beam.rst + examples/ex_dmsp_methods.rst diff --git a/docs/installation.rst b/docs/installation.rst index 4ecc22a0..1c922eba 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -37,17 +37,18 @@ You may either install pysatMadrigal via pip or by cloning the git repository pip install pysatMadrigal -2. Clone the git repository and use the ``setup.py`` file to install +2. Clone the git repository and use the ``pyproject.toml`` file to install :: git clone https://github.com/pysat/pysatMadrigal.git - # Install on the system (root privileges required) - sudo python3 setup.py install + # Move into the pysatMadrigal directory. Then build the wheel + python -m build . + - # Install at the user level - python3 setup.py install --user + # Install at the user or system level, depending on privledges + pip install . - # Install at the user level with the intent to develop locally - python3 setup.py develop --user + # Install with the intent to develop locally + pip install -e . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..c2a20512 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,89 @@ +[build-system] +requires = ["setuptools >= 38.6", "pip >= 10"] +build-backend = "setuptools.build_meta" + +[project] +name = "pysatMadrigal" +version = "0.1.0" +description = 'Madrigal instrument support for the pysat ecosystem' +readme = "README.md" +requires-python = ">=3.6" +license = {file = "LICENSE"} +authors = [ + {name = "Angeline G. Burrell et al.", email = "pysat.developers@gmail.com"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows" +] +keywords = [ + "pysat", + "ionosphere", + "Madrigal", + "CEDAR", + "thermosphere", + "GPS", + "GNSS", + "TEC", + "Jicamarca", + "DMSP", + "ISR", + "Incoherent scatter radar", +] +dependencies = [ + "h5py", + "madrigalWeb", + "numpy", + "packaging", + "pandas", + "pysat>=3.1.0", + "xarray"] + +[project.optional-dependencies] +test = [ + "coveralls < 3.3", + "flake8", + "flake8-docstrings", + "hacking >= 1.0", + "pytest", + "pytest-cov", + "pytest-ordering" +] +doc = [ + "extras_require", + "ipython", + "m2r2", + "numpydoc", + "pyproject_parser", + "sphinx", + "sphinx_rtd_theme >= 1.2.2" +] + +[project.urls] +Documentation = "https://pysatmadrigal.readthedocs.io/en/latest/" +Source = "https://github.com/pysat/pysatMadrigal" + +[tool.coverage.report] + +[tool.pytest.ini_options] +addopts = "-x --cov=pysatMadrigal" +markers = [ + "all_inst", + "download", + "no_download", + "load_options", + "first", + "second" +] diff --git a/pysatMadrigal/__init__.py b/pysatMadrigal/__init__.py index 654bab71..3c72456a 100644 --- a/pysatMadrigal/__init__.py +++ b/pysatMadrigal/__init__.py @@ -5,13 +5,12 @@ """ -import os +try: + from importlib import metadata +except ImportError: + import importlib_metadata as metadata + from pysatMadrigal import instruments # noqa F401 from pysatMadrigal import utils # noqa F401 -# set version -here = os.path.abspath(os.path.dirname(__file__)) -version_filename = os.path.join(here, 'version.txt') -with open(version_filename, 'r') as version_file: - __version__ = version_file.read().strip() -del here, version_filename, version_file +__version__ = metadata.version('pysatMadrigal') diff --git a/pysatMadrigal/version.txt b/pysatMadrigal/version.txt deleted file mode 100644 index 6e8bf73a..00000000 --- a/pysatMadrigal/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.1.0 diff --git a/setup.cfg b/setup.cfg index 6e68fba9..a2f45100 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,72 +1,9 @@ [metadata] name = pysatMadrigal -version = file: pysatMadrigal/version.txt -url = https://github.com/pysat/pysatMadrigal -author = Angeline G. Burrell, et al. -author_email = pysat.developers@gmail.com -description = 'Madrigal instrument support for the pysat ecosystem' -keywords = - pysat - ionosphere - Madrigal - CEDAR - thermosphere - GPS - GNSS - TEC - Jicamarca - DMSP - ISR - Incoherent scatter radar -classifiers = - Development Status :: 4 - Beta - Topic :: Scientific/Engineering :: Physics - Topic :: Scientific/Engineering :: Atmospheric Science - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Natural Language :: English - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Operating System :: MacOS :: MacOS X - Operating System :: POSIX :: Linux - Operating System :: POSIX :: Linux - Operating System :: Microsoft :: Windows -license_file = LICENSE -long_description = file: README.md -long_description_content_type = text/markdown - -[options] -python_requires = >= 3.6 -setup_requires = setuptools >= 38.6; pip >= 10 -include_package_data = True -zip_safe = False -packages = find: -install_requires = h5py - madrigalWeb - numpy - packaging - pandas - pysat - xarray - -[coverage:report] -omit = */instruments/templates/* +version = 0.1.0 [flake8] max-line-length = 80 ignore = W503 D200 D202 - -[tool:pytest] -markers = - all_inst: tests all instruments - download: tests for downloadable instruments - no_download: tests for instruments without download support - load_options: tests for instruments with additional options - first: first tests to run - second: second tests to run diff --git a/setup.py b/setup.py deleted file mode 100644 index 2e9b3e74..00000000 --- a/setup.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2020, Authors -# Full license can be found in License.md and AUTHORS.md -# ----------------------------------------------------------------------------- -"""Package setup.""" - -from setuptools import setup - - -# Run setup. Setuptools will look for parameters in [metadata] section of -# setup.cfg -setup()