Skip to content

Rename package to epidatpy #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
inv dist
- uses: actions/upload-artifact@v2
with:
name: delphi_epidata
name: epidatpy
- name: Upload Release Asset
uses: AButler/upload-release-assets@v2.0
with:
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Delphi Epidata Python Client
# Delphi Epidata Python Client `epidatpy`

[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url] [![PyPi][pypi-image]][pypi-url] [![Read the Docs][docs-image]][docs-url]

Expand All @@ -11,7 +11,13 @@ For a short-term fix, the package can be used with the old name by installing wi
Install latest version:

```sh
pip install -e "git+https://github.com/cmu-delphi/delphi-epidata-py.git#egg=delphi_epidata"
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
```

old name version

```sh
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git@delphi_epidata-before-rename#egg=delphi_epidata"
```

## Usage
Expand Down Expand Up @@ -46,20 +52,20 @@ inv release # upload the current version to pypi

The release consists of multiple steps which can be all done via the GitHub website:

1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/delphi-epidata-py/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button.
1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/delphi-epidata-py/pulls)
1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/epidatpy/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button.
1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls)
1. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
1. Once approved and merged, another GitHub action job starts which automatically will
1. create a git tag
1. create another [Pull Request](https://github.com/cmu-delphi/delphi-epidata-py/pulls) to merge the changes back to the `dev` branch
1. create a [GitHub release](https://github.com/cmu-delphi/delphi-epidata-py/releases) with automatically derived release notes
1. create another [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls) to merge the changes back to the `dev` branch
1. create a [GitHub release](https://github.com/cmu-delphi/epidatpy/releases) with automatically derived release notes
1. Done

[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[mit-url]: https://opensource.org/licenses/MIT
[github-actions-image]: https://github.com/cmu-delphi/delphi-epidata-py/workflows/ci/badge.svg
[github-actions-url]: https://github.com/cmu-delphi/delphi-epidata-py/actions
[pypi-image]: https://img.shields.io/pypi/v/delphi-epidata
[pypi-url]: https://pypi.python.org/pypi/delphi-epidata/
[docs-image]: https://readthedocs.org/projects/delphi-epidata/badge/?version=latest
[docs-url]: https://delphi-epidata.readthedocs.io/en/latest/?badge=latest
[github-actions-image]: https://github.com/cmu-delphi/epidatpy/workflows/ci/badge.svg
[github-actions-url]: https://github.com/cmu-delphi/epidatpy/actions
[pypi-image]: https://img.shields.io/pypi/v/epidatpy
[pypi-url]: https://pypi.python.org/pypi/epidatpy/
[docs-image]: https://readthedocs.org/projects/epidatpy/badge/?version=latest
[docs-url]: https://epidatpy.readthedocs.io/en/latest/?badge=latest
29 changes: 15 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../delphi_epidata'))

sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../epidatpy"))

# -- Project information -----------------------------------------------------

project = 'Delphi Epidata API client'
copyright = '2021, Delphi research group' # pylint: disable=redefined-builtin
author = 'Delphi research group'
project = "Delphi Epidata API client"
copyright = "2021, Delphi research group" # pylint: disable=redefined-builtin
author = "Delphi research group"

# The full version, including alpha/beta/rc tags
release = '1.0.0'
release = "1.0.0"


# -- General configuration ---------------------------------------------------
Expand All @@ -31,29 +32,29 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx_autodoc_typehints',
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
# 'matplotlib.sphinxext.plot_directive'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

add_module_names = False
autoclass_content = 'class'
autodoc_typehints = 'description'
autoclass_content = "class"
autodoc_typehints = "description"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -63,7 +64,7 @@
html_theme_options = {
"extra_nav_links": {
"Delphi group": "https://delphi.cmu.edu/",
"Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata"
"Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata",
}
}

Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Basic examples

To obtain all available sources of epidemiological data, we can use the following command:

>>> from delphi_epidata.request import CovidcastEpidata, EpiRange
>>> from epidatpy.request import CovidcastEpidata, EpiRange
>>> epidata = CovidcastEpidata()
>>> print(list(epidata.source_names))
['chng-cli', 'chng-covid', 'covid-act-now', 'doctor-visits', 'fb-survey', 'google-symptoms', 'hhs', 'hospital-admissions', 'indicator-combination-cases-deaths', 'jhu-csse', 'quidel-covid-ag', 'safegraph-weekly', 'usa-facts', 'ght', 'google-survey', 'indicator-combination-nmf', 'quidel-flu', 'safegraph-daily', 'nchs-mortality']
Expand All @@ -26,7 +26,7 @@ To obtain smoothed estimates of COVID-like illness from our symptom survey,
distributed through Facebook (`fb-survey`), for every county in the United States between
2020-05-01 and 2020-05-07:

>>> from delphi_epidata.request import EpiRange
>>> from epidatpy.request import EpiRange
>>> apicall = epidata[("fb-survey", "smoothed_cli")].call(
... 'county', "*", EpiRange(20200501, 20200507),
... )
Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Delphi Epi Data
===============

This package provides Python access to the `Delphi Epidata API
<https://cmu-delphi.github.io/delphi-epidata/api>`_ published by
<https://cmu-delphi.github.io/delphi-epidata/>`_ published by
the `Delphi group <https://delphi.cmu.edu>`_ at `Carnegie Mellon University
<https://www.cmu.edu>`_.

The package source code and bug tracker can be found `on GitHub
<https://github.com/cmu-delphi/delphi-epidata-py>`_.
<https://github.com/cmu-delphi/epidatpy>`_.


.. note :: **You should consider subscribing** to the `API mailing list
Expand All @@ -29,12 +29,12 @@ Installation
------------

This package is available on PyPI as `covidcast
<https://pypi.org/project/delphi-epidata/>`_, and can be installed using ``pip`` or
<https://pypi.org/project/epidatpy/>`_, and can be installed using ``pip`` or
your favorite Python package manager:

.. code-block:: sh

pip install delphi-epidata
pip install epidatpy

The package requires `pandas <https://pandas.pydata.org/>`_ and `requests
<https://requests.readthedocs.io/en/master/>`_; these should be installed
Expand Down
8 changes: 4 additions & 4 deletions docs/signals_covid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Metadata
Many data sources and signals are available, so one can also obtain a data frame
of all signals and their associated metadata:

>>> from delphi_epidata.request import CovidcastEpidata
>>> from epidatpy.request import CovidcastEpidata
>>> covid_ds = CovidcastEpidata()
>>> df_source = covid_ds.source_df
>>> df_signal = covid_ds.signal_df
Expand All @@ -34,12 +34,12 @@ which has the property ``source_df`` and ``signal_df``, two data frames containi
the information of all available sources and signals.
More details of the two data frames are listed below.

.. autoclass:: delphi_epidata.request.CovidcastDataSources()
.. autoclass:: epidatpy.request.CovidcastDataSources()
:members:

More metadata statistics can also be obtained as follows:

>>> from delphi_epidata.request import Epidata
>>> from epidatpy.request import Epidata
>>> df = Epidata.covidcast_meta().df()

.. autofunction:: delphi_epidata.request.Epidata.covidcast_meta()
.. autofunction:: epidatpy.request.Epidata.covidcast_meta()
File renamed without changes.
2 changes: 1 addition & 1 deletion delphi_epidata/_constants.py → epidatpy/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
__version__: Final = "1.0.0"


HTTP_HEADERS: Final = {"User-Agent": f"delphi_epidata/{__version__}"}
HTTP_HEADERS: Final = {"User-Agent": f"epidatpy/{__version__}"}

BASE_URL: Final = "https://delphi.cmu.edu/epidata/"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
[tool.black]
line-length = 120
target-version = ['py38']
include = 'delphi_epidata'
include = 'epidatpy'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ current_version = 1.0.0
commit = False
tag = False

[bumpversion:file:delphi_epidata/_version.py]
[bumpversion:file:epidatpy/_version.py]
[bumpversion:file:docs/conf.py]

[bdist_wheel]
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@


setuptools.setup(
name="delphi_epidata",
name="epidatpy",
version="1.0.0",
author="Alex Reinhart",
author_email="areinhar@stat.cmu.edu",
description="A programmatic interface to Delphi's Epidata API.",
long_description=pathlib.Path('README.md').read_text(),
long_description=pathlib.Path("README.md").read_text(),
long_description_content_type="text/markdown",
url="https://github.com/cmu-delphi/delphi-epidata-py",
url="https://github.com/cmu-delphi/epidatpy",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
Expand All @@ -20,7 +20,7 @@
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
python_requires='>=3.6',
install_requires=[f.strip() for f in pathlib.Path('requirements.txt').read_text().split('\n') if f],
# package_data={'delphi_epidata': []}
python_requires=">=3.6",
install_requires=[f.strip() for f in pathlib.Path("requirements.txt").read_text().split("\n") if f],
# package_data={'epidatpy': []}
)
2 changes: 1 addition & 1 deletion smoke_covid_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from delphi_epidata.request import CovidcastEpidata, EpiRange
from epidatpy.request import CovidcastEpidata, EpiRange

epidata = CovidcastEpidata()
print(list(epidata.source_names))
Expand Down
2 changes: 1 addition & 1 deletion smoke_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import date
from delphi_epidata.request import Epidata, EpiRange
from epidatpy.request import Epidata, EpiRange

apicall = Epidata.covidcast("fb-survey", "smoothed_cli", "day", "nation", EpiRange(20210405, 20210410), "us")

Expand Down
2 changes: 1 addition & 1 deletion smoke_test_async.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from asyncio import get_event_loop
from delphi_epidata.async_request import Epidata
from epidatpy.async_request import Epidata


async def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ROOT_DIR = Path(__file__).parent
SETUP_FILE = ROOT_DIR.joinpath("setup.py")
TEST_DIR = ROOT_DIR.joinpath("tests")
SOURCE_DIR = ROOT_DIR.joinpath("delphi_epidata")
SOURCE_DIR = ROOT_DIR.joinpath("epidatpy")
TOX_DIR = ROOT_DIR.joinpath(".tox")
COVERAGE_FILE = ROOT_DIR.joinpath(".coverage")
COVERAGE_DIR = ROOT_DIR.joinpath("htmlcov")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from delphi_epidata import __version__
from epidatpy import __version__


def test_version() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from delphi_epidata._model import EpiRange, format_item, format_list
from epidatpy._model import EpiRange, format_item, format_list


def test_epirange() -> None:
Expand Down