Skip to content

Commit

Permalink
Starting repo, added in pieces for flu data
Browse files Browse the repository at this point in the history
  • Loading branch information
rogersbw committed Aug 27, 2024
1 parent ea6b349 commit b1acc80
Show file tree
Hide file tree
Showing 71 changed files with 490,880 additions and 64 deletions.
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
# reichlab-python-template
# jacques_flu

[REPLACE WITH A DESCRIPTION OF YOUR PROJECT]

A Python template for Reich Lab projects.

This repo contains a Python package with minimal functionality. It serves as a starting point for new projects (it can be selected as the template when creating a new repo in the Reich Lab org).

There as some opinionated choices here (explained below) which people should override as needed. The main goal is to have a consistent starting point to get up and running with a new Python code base.

## Getting started

[REMOVE THIS SECTION AFTER FOLLOWING THE INSTRUCTIONS BELOW]

If you're using this repo as a template for a new project, make the following changes:

1. Rename the `reichlab_python_template` directory (under `src`) to the name of your package (no hyphens!).

2. Replace all instances of `reichlab-python-template` with the name of your repo/project.

3. Replace all instances of `reichlab_python_template` with the name of your package (remember that Python module names cannot contain hyphens).

4. Update [`pyproject.toml`](pyproject.toml). This file is required and will describe several aspects of your project. `pyproject.toml` replaces `setup.py` and is described in detail on [Python's packaging website](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).

5. Follow the _Setup for local development_ instructions below to ensure that everything works as expected.
This project is an application of the just another conditional quantile estimator (Jacques) method to predict flu data.

#NOTE: In order to run this package, you will have to copy the data-raw folder from https://github.com/reichlab/flusion into the src/jacques_flu directory.

## Installing and running the package (no development)

Expand Down
28 changes: 20 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "reichlab-python-template"
description = "Python template for Reich Lab projects"
name = "jacques_flu"
description = "Using jacques to analyze flu data"
license = {text = "MIT License"}
readme = "README.md"
requires-python = '>=3.10'
Expand All @@ -13,7 +13,19 @@ dynamic = ["version"]
dependencies = [
"structlog",
"rich",
"toml"
"toml",
"pandas>=2.2.2",
"numpy>=1.26.1",
"tensorflow>=2.16.1,<3",
"tensorflow-probability==0.24.0",
"tf-keras>=2.16,<3",
"matplotlib >=3.5.1,<4",
"pymmwr",
"polars",
"pyarrow",
"timeseriesutils @ git+https://github.com/reichlab/timeseriesutils",
"jacques @ git+https://github.com/reichlab/jacques#egg=BWRedits", # referencing my branch for local work
'data-pipeline @ git+https://github.com/reichlab/flusion.git#subdirectory=code/data-pipeline',
]

[project.optional-dependencies]
Expand All @@ -28,18 +40,18 @@ dev = [
]

[project.entry-points."console_scripts"]
reichlab_python_template = "reichlab_python_template.app:main"
reichlab_python_template = "jacques_flu.app:main"

[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"]

[tools.setuptools]
packages = ["reichlab_python_template"]
packages = ["jacques_flu"]

[tool.reichlab_python_template]
[tool.jacques_flu]
# to write json-formatted logs to disk, uncomment the following line specify the file location
# log_file = "/path/to/log/files/rechlab_python_template.log"
# log_file = "/path/to/log/files/jacques_flu.log"

[tool.ruff]
line-length = 120
Expand All @@ -52,4 +64,4 @@ inline-quotes = "double"
quote-style = "double"

[tool.setuptools.dynamic]
version = {attr = "reichlab_python_template.__version__"}
version = {attr = "jacques_flu.__version__"}
199 changes: 176 additions & 23 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,65 +1,218 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements/requirements-dev.txt
#
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra dev -o requirements/requirements-dev.txt
absl-py==2.1.0
# via
# keras
# tensorboard
# tensorflow
# tensorflow-probability
astunparse==1.6.3
# via tensorflow
attrs==24.2.0
# via pymmwr
certifi==2024.7.4
# via requests
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.2
# via requests
cloudpickle==3.0.0
# via tensorflow-probability
contourpy==1.2.1
# via matplotlib
coverage==7.5.1
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
cycler==0.12.1
# via matplotlib
data-pipeline @ git+https://github.com/reichlab/flusion.git@ab82656e4724f1c33b4cf8b133f49befc4dc8e63#subdirectory=code/data-pipeline
# via jacques-flu (pyproject.toml)
decorator==5.1.1
# via tensorflow-probability
distlib==0.3.8
# via virtualenv
dm-tree==0.1.8
# via tensorflow-probability
filelock==3.14.0
# via virtualenv
flatbuffers==24.3.25
# via tensorflow
fonttools==4.53.1
# via matplotlib
freezegun==1.5.0
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
gast==0.6.0
# via
# tensorflow
# tensorflow-probability
google-pasta==0.2.0
# via tensorflow
grpcio==1.66.0
# via
# tensorboard
# tensorflow
h5py==3.11.0
# via
# keras
# tensorflow
identify==2.5.36
# via pre-commit
idna==3.8
# via requests
iniconfig==2.0.0
# via pytest
jacques @ git+https://github.com/reichlab/jacques@97894a149661a5efa7227fe46518519ffe459ef3#egg=BWRedits
# via jacques-flu (pyproject.toml)
keras==3.5.0
# via tensorflow
kiwisolver==1.4.5
# via matplotlib
libclang==18.1.1
# via tensorflow
markdown==3.7
# via tensorboard
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via werkzeug
matplotlib==3.9.2
# via jacques-flu (pyproject.toml)
mdurl==0.1.2
# via markdown-it-py
ml-dtypes==0.4.0
# via
# keras
# tensorflow
mypy==1.10.0
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
mypy-extensions==1.0.0
# via mypy
namex==0.0.8
# via keras
nodeenv==1.8.0
# via pre-commit
numpy==1.26.4
# via
# jacques-flu (pyproject.toml)
# contourpy
# h5py
# keras
# matplotlib
# ml-dtypes
# opt-einsum
# pandas
# pyarrow
# scipy
# tensorboard
# tensorflow
# tensorflow-probability
# timeseriesutils
opt-einsum==3.3.0
# via tensorflow
optree==0.12.1
# via keras
packaging==24.0
# via pytest
# via
# keras
# matplotlib
# pytest
# tensorboard
# tensorflow
pandas==2.2.2
# via
# jacques-flu (pyproject.toml)
# timeseriesutils
pillow==10.4.0
# via matplotlib
platformdirs==4.2.1
# via virtualenv
pluggy==1.5.0
# via pytest
polars==1.5.0
# via jacques-flu (pyproject.toml)
pre-commit==3.7.0
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
protobuf==4.25.4
# via
# tensorboard
# tensorflow
pyarrow==17.0.0
# via jacques-flu (pyproject.toml)
pygments==2.18.0
# via rich
pymmwr==0.2.2
# via jacques-flu (pyproject.toml)
pyparsing==3.1.4
# via matplotlib
pytest==8.2.0
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
python-dateutil==2.9.0.post0
# via freezegun
# via
# freezegun
# matplotlib
# pandas
pytz==2024.1
# via pandas
pyyaml==6.0.1
# via pre-commit
requests==2.32.3
# via tensorflow
rich==13.7.1
# via python-app (pyproject.toml)
# via
# jacques-flu (pyproject.toml)
# keras
ruff==0.4.3
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
scipy==1.14.1
# via timeseriesutils
setuptools==73.0.1
# via
# nodeenv
# tensorboard
# tensorflow
six==1.16.0
# via python-dateutil
# via
# astunparse
# google-pasta
# python-dateutil
# tensorboard
# tensorflow
# tensorflow-probability
structlog==24.1.0
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
tensorboard==2.17.1
# via tensorflow
tensorboard-data-server==0.7.2
# via tensorboard
tensorflow==2.17.0
# via
# jacques-flu (pyproject.toml)
# tf-keras
tensorflow-probability==0.24.0
# via jacques-flu (pyproject.toml)
termcolor==2.4.0
# via tensorflow
tf-keras==2.17.0
# via jacques-flu (pyproject.toml)
timeseriesutils @ git+https://github.com/reichlab/timeseriesutils@d25f33db30a8d5252329269ec9d205984f980f6c
# via jacques-flu (pyproject.toml)
toml==0.10.2
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
types-toml==0.10.8.20240310
# via python-app (pyproject.toml)
# via jacques-flu (pyproject.toml)
typing-extensions==4.11.0
# via mypy
# via
# mypy
# optree
# tensorflow
tzdata==2024.1
# via pandas
urllib3==2.2.2
# via requests
virtualenv==20.26.1
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
# setuptools
werkzeug==3.0.4
# via tensorboard
wheel==0.44.0
# via astunparse
wrapt==1.16.0
# via tensorflow
Loading

0 comments on commit b1acc80

Please sign in to comment.