Skip to content

Commit

Permalink
Copy changes from documentation
Browse files Browse the repository at this point in the history
- epispot/
    - Update __init__.py with new docs and funcs
    - Update fitters.py with new docs
- Update README-nightly.md with new changes
  • Loading branch information
quantum9Innovation committed Jul 25, 2021
1 parent f131af9 commit 71a70a0
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 59 deletions.
23 changes: 13 additions & 10 deletions README-nightly.md
Expand Up @@ -6,8 +6,8 @@

A Python package for the mathematical modeling of infectious diseases via compartmental models. Originally designed for epidemiologists, epispot can be adapted for almost any type of modeling scenario.

> This is a nightly version of epispot and may contain possibly unstable code.\
> **Please see usage instructions prior to adding this project as a dependency**\
> This is a nightly version of epispot and may contain possibly unstable code.
> **Please see usage instructions prior to adding this project as a dependency**
> If you prefer to use the stable version of epispot, please see
> the [project on PyPI](https://pypi.org/project/epispot)
Expand Down Expand Up @@ -78,9 +78,10 @@ This is the hardest way to install `epispot-nightly` but it can be particularly
Clone the repository with:

```shell
git clone https://github.com/epispot/epispot # clone epispot/epispot
cd epispot # open project
pip install -r requirements-nightly.txt # install package requirements
git clone https://github.com/epispot/epispot
cd epispot/requirements
pip install -r pre-requirements.txt # helps avoid version conflicts
pip install -r requirements-nightly.txt
```

If you're planning on helping out in the development process, it will be helpful to install a few extra requirements with:
Expand Down Expand Up @@ -111,16 +112,18 @@ Please also note that security updates are not provided on previous nightly vers

## Getting Started

Make sure you are already familiar with [epispot](https://www.pypi.org/project/epispot). If not, you can find epispot's auto-generated documentation [here](https://epispot.github.io/epispot/). Additionally, we highly recommend reading the [epispot manual](https://epispot.gitbook.io) to get a better understanding of the documentation and how to use epispot.
Make sure you are already familiar with [epispot](https://www.pypi.org/project/epispot). If not, continue reading the auto-generated documentation published to this site. Additionally, we highly recommend reading the [epispot manual](https://epispot.gitbook.io) to get a better understanding of the documentation and how to use epispot.

## Statuses
## Current Statuses

Please note that these statuses reflect the most recent CI checks and are not related to this specific version. The following statuses show the progress of the current development.

| Pipeline | Status |
| --- | --- |
| Travis CI | [![Build Status](https://www.travis-ci.com/epispot/epispot.svg?branch=master)](https://www.travis-ci.com/epispot/epispot) |
| Build (3.7-3.9) | [![Build](https://github.com/epispot/epispot/actions/workflows/build.yml/badge.svg)](https://github.com/epispot/epispot/actions/workflows/build.yml) |
| CodeCov | [![codecov](https://codecov.io/gh/epispot/epispot/branch/master/graph/badge.svg?token=WGIM127RFY)](https://codecov.io/gh/epispot/epispot) |
| PyPI main | ![latest-release](https://shields.mitmproxy.org/pypi/v/epispot.svg?color=success) |
| PyPI nightly | ![latest-release](https://shields.mitmproxy.org/pypi/v/epispot-nightly.svg?color=success) |
| PyPI main (latest) | ![latest-release](https://shields.mitmproxy.org/pypi/v/epispot.svg?color=success) |
| PyPI nightly (latest) | ![latest-release](https://shields.mitmproxy.org/pypi/v/epispot-nightly.svg?color=success) |
| Security | ![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/epispot/epispot?color=success&label=known%20vulnerabilities&query=VULNERABILITY%20is:open%20is:issue) |

## Contributing
Expand Down
101 changes: 52 additions & 49 deletions epispot/__init__.py
Expand Up @@ -2,7 +2,7 @@
.. include:: ../README.md
<!--
Documentation available at:
https://epispot.github.io/epispot/en/v3.0.0-alpha-1
https://epispot.github.io/epispot/en/v3.0.0-alpha-2
-->
"""

Expand Down Expand Up @@ -48,70 +48,73 @@ def _dependency_check():
from . import plots


def _sanity_check():
"""Pre-defined sanity check to check for installation errors"""

if not version or not source: # pragma: no cover
message = \
'''
Version information and/or source for your epispot installation could not be found.
This likely means
(1) this version of epispot is deprecated or dated
(2) your installation of epispot is unstable
Try reinstalling epispot
(1) From PyPI:
$ pip install epispot
(2) From Anaconda:
$ conda config --add channels conda-forge
$ conda install -c conda-forge epispot
(3) From the GitHub Source:
$ git clone https://github.com/epispot/epispot
$ cd epispot
$ python install setup-nightly.py
If this fails or has failed before, then revert to epispot's last stable version.
Again, you can do this via
(1) PyPI:
(a) Go to https://pypi.org/project/epispot
(b) Scroll to the last MAJOR release in the form `a.0.0`
(c) Install via `$ pip install epispot==a.0.0` -- replace `a` with version #
(2) GitHub Source:
(a) Go to https://github.com/epispot/epispot
(b) Click the 'branches' tab
(c) Select the last branch with name `vA.0.0` for some version number A
(d) Install as `.zip`
(e) Unzip
(f) Run `$ python install setup.py`
'''
raise DeprecationWarning(message)
# helper funcs
def _check_versions():
"""Checks for version conflicts"""
pass

def _check_install():
"""Checks for installation errors"""
pass

def _check_updates():
"""Checks for updates"""
pass

def sanity_check():
"""
Sanity check to check for basic installation errors,
version conflicts, upgrades, etc.
**Run this if you experience any problems with epispot and before
submitting any issues**
"""
# check for installation errors
if not source or not version:
_check_install()

# check for version conflicts
import sys
if (sys.version_info[0] < 3) or \
(sys.version_info[0] == 3 and sys.version_info[1] < 7):
raise RuntimeError('Epispot requires Python 3.7 or later') # pragma: no cover
else:
_check_versions()

# check for updates
_check_updates()


# version info
version = '3.0.0-alpha-1'
version = '3.0.0-alpha-2'
"""
Epispot's version info (updated every nightly release)
Get with:
Epispot's version info (updated every release)\n
Check version information with:
```
>>> print(epispot.version)
```
Version information is also available through the `__version__`
property, included for legacy support.
"""
__version__ = version # alias for version

stable = False
"""
Build stability:
- True main package (stable)
- False nightly package (possibly unstable)
- True main package (stable)
- False nightly package (possibly unstable)
"""

# metadata
source = 'https://www.github.com/epispot/epispot'
"""URL to GitHub source"""
docs = 'https://epispot.github.io/epispot'
"""Project documentation (not version-specific)"""
"""URL to VCS source"""
raw = f'https://raw.githubusercontent.com/epispot/epispot/v{version}/'
"""URL to raw VCS source (must append file path)"""
docs = f'https://epispot.github.io/epispot/en/v{version}/'
"""Project documentation (version-specific)"""
issues = 'https://www.github.com/epispot/epispot/issues'
"""Submit new issues or bugs here"""


_sanity_check() # complete installation
del _sanity_check
"""Bug tracker"""
8 changes: 8 additions & 0 deletions epispot/fitters.py
Expand Up @@ -15,6 +15,10 @@ def grad_des(get_model_pred, real_data,
N, samples, delta=0.0001,
verbose=False): # pragma: no cover
"""
.. warning::
This function is currently deprecated.
Fixes will be added in future alpha releases.
The gradient descent fitter. This is not stochastic.
For long timespans, this may take a long time to converge.
Expand Down Expand Up @@ -98,6 +102,10 @@ def tree_search(get_model_pred, real_data,
epochs, N, samples,
verbose=False): # pragma: no cover
"""
.. warning::
This function is currently deprecated.
Fixes will be added in future alpha releases.
Note: This is an experimental fitter
"""

Expand Down

0 comments on commit 71a70a0

Please sign in to comment.