Skip to content

Commit

Permalink
v1.1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinnglabs committed Dec 26, 2023
1 parent 128d887 commit 3527c65
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 67 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
pip install -U pip
pip install -U setuptools
pip install -r requirements.txt
pip install -r requirements-test.txt
python -m pip install -U --editable .
python -m pip install -U --editable ".[dev]"
- name: Test with pytest
run: pytest -vs tests/ --cov orbit/
run: python -m pytest tests/
8 changes: 1 addition & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
include LICENSE
include README.md
include pyproject.toml
include *.txt
include requirements.txt
include requirements-test.txt
include orbit/stan/*.stan
include orbit/stylelib/*.mplstyle

prune orbit/stan_compiled
prune orbit/stan/dlt
prune orbit/stan/ets
prune orbit/stan/ktrlite
prune orbit/stan/lgt
prune orbit/stan/*.hpp

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
25 changes: 4 additions & 21 deletions docs/tutorials/regression_penalty.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2022-04-28T21:49:43.395926Z",
"start_time": "2022-04-28T21:49:40.870237Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/towinazure/opt/miniconda3/envs/orbit39/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
Expand All @@ -54,22 +45,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2022-04-28T21:49:43.400898Z",
"start_time": "2022-04-28T21:49:43.398300Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.1.4.2\n"
]
}
],
"outputs": [],
"source": [
"print(orbit.__version__)"
]
Expand Down
10 changes: 8 additions & 2 deletions orbit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
name = "orbit"
__version__ = "1.1.4.2"
from pathlib import Path

about = {}
here = Path(__file__).parent.resolve()

with open(here / "__version__.py", "r") as f:
exec(f.read(), about)
__version__ = about["__version__"]
1 change: 1 addition & 0 deletions orbit/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.1.4.3"
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ readme = "README.md"
requires-python = ">=3.7"
dependencies = [
"cmdstanpy>=1.0.4",
"numpy>=1.15.4",
"matplotlib>=2.0.0",
"pandas>=1.0.4",
"numpy>=1.18",
"pandas>=1.0.3",
"tqdm>=4.36.1",
"importlib_resources",
"matplotlib>=3.3.2",
"scipy>=1.4.1",
"torch>=1.11.0",
"seaborn>=0.10.0",
"pyro-ppl>=1.4.0",
"arviz",
]
license = {text = "Apache License 2.0"}
classifiers = [
Expand All @@ -39,4 +44,11 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[project.optional-dependencies]
dev = [
"setuptools>=64",
"wheel",
"pytest",
"black",
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ statsmodels>=0.11.1
arviz
cmdstanpy>=1.0.4
setuptools>=42
importlib_resources
46 changes: 23 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def requirements(filename="requirements.txt"):
return f.readlines()


class PyTestCommand(test_command):
def finalize_options(self):
test_command.finalize_options(self)
self.test_args = ["-v"] # test args
self.test_suite = True
# class PyTestCommand(test_command):
# def finalize_options(self):
# test_command.finalize_options(self)
# self.test_args = ["-v"] # test args
# self.test_suite = True

def run_tests(self):
import pytest
# def run_tests(self):
# import pytest

errcode = pytest.main(self.test_args)
sys.exit(errcode)
# errcode = pytest.main(self.test_args)
# sys.exit(errcode)


def build_stan_model(target_dir):
Expand Down Expand Up @@ -148,8 +148,7 @@ def run(self):
target_dir = os.path.join(self.build_lib, MODEL_TARGET_DIR)
self.mkpath(target_dir)

print("Not a dry run, run with build, target_dir:")
print("building with target_dir: {}".format(target_dir))
print("Not a dry run, run with build, target_dir: {}".format(target_dir))

build_stan_model(target_dir)

Expand Down Expand Up @@ -182,8 +181,7 @@ def run(self):
target_dir = os.path.join(self.project_dir, MODEL_TARGET_DIR)
self.mkpath(target_dir)

print("Not a dry run, run with editable, target_dir:")
print("building with target_dir: {}".format(target_dir))
print("Not a dry run, run with editable, target_dir: {}".format(target_dir))

build_stan_model(target_dir)

Expand All @@ -200,7 +198,16 @@ def get_tag(self):
return "py3", "none", plat


about = {}
here = Path(__file__).parent.resolve()
with open(here / "orbit" / "__version__.py", "r") as f:
exec(f.read(), about)


setup(
version=about["__version__"],
packages=find_packages(),
name="orbit-ml",
author="Edwin Ng, Zhishi Wang, Steve Yang, Yifeng Wu, Jing Pan",
author_email="[email protected]",
description=DESCRIPTION,
Expand All @@ -211,23 +218,16 @@ def get_tag(self):
cmdclass={
"build_ext": BuildExtCommand,
"build_py": BuildPyCommand,
"editable_wheel": EditableWheel,
"bdist_wheel": BDistWheelABINone,
# "develop": DevelopCommand,
"test": PyTestCommand,
# "test": PyTestCommand,
},
test_suite="orbit.tests",
license="Apache License 2.0",
long_description=read_long_description(),
long_description_content_type="text/markdown",
name="orbit-ml",
packages=find_packages(),
url="https://orbit-ml.readthedocs.io/en/stable/",
# version=VERSION, # being maintained by source module
ext_modules=[Extension("orbit.stan_compiled", [])],
zip_safe=False,
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
)
12 changes: 4 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import pytest
import pandas as pd
import numpy as np
import pkg_resources
import importlib_resources
from copy import deepcopy

from orbit.utils.simulation import make_trend, make_seasonality, make_regression


@pytest.fixture
def iclaims_training_data():
test_file = pkg_resources.resource_filename(
"tests", "resources/iclaims.example.csv"
)
test_file = importlib_resources.files("tests") / "resources/iclaims.example.csv"
df = pd.read_csv(test_file, parse_dates=["week"])
return df


@pytest.fixture
def m3_monthly_data():
test_file = pkg_resources.resource_filename("tests", "resources/m3-monthly.csv")
test_file = importlib_resources.files("tests") / "resources/m3-monthly.csv"
df = pd.read_csv(test_file, parse_dates=["date"])
return df

Expand Down Expand Up @@ -497,9 +495,7 @@ def ca_hourly_electricity_data():
Sources: https://github.com/pratha19/Hourly_Energy_Consumption_Prediction
"""
test_file = pkg_resources.resource_filename(
"tests", "resources/hourly1418CA_2018.csv"
)
test_file = importlib_resources.files("tests") / "resources/hourly1418CA_2018.csv"
df = pd.read_csv(
test_file,
parse_dates=["Dates", "Date"],
Expand Down

0 comments on commit 3527c65

Please sign in to comment.