Skip to content

Remove pymc3/examples #4352

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 2 commits into from
Dec 20, 2020
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: ^(docs/logos|pymc3/examples/data)/
exclude: ^(docs/logos|pymc3/tests/data)/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include pymc3/examples/data *
recursive-include pymc3/tests/data *
recursive-include source *
# because of an upload-size limit by PyPI, we're temporarily removing docs from the tarball:
recursive-exclude docs *
Expand Down
11 changes: 9 additions & 2 deletions pymc3/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io
import os
import pkgutil
import urllib.request

from copy import copy
from typing import Any, Dict, List
Expand All @@ -34,6 +35,7 @@
"align_minibatches",
"Data",
]
BASE_URL = "https://raw.githubusercontent.com/pymc-devs/pymc-examples/main/examples/data/{filename}"


def get_data(filename):
Expand All @@ -48,8 +50,13 @@ def get_data(filename):
-------
BytesIO of the data
"""
data_pkg = "pymc3.examples"
return io.BytesIO(pkgutil.get_data(data_pkg, os.path.join("data", filename)))
data_pkg = "pymc3.tests"
try:
content = pkgutil.get_data(data_pkg, os.path.join("data", filename))
except FileNotFoundError:
with urllib.request.urlopen(BASE_URL.format(filename=filename)) as handle:
content = handle.read()
return io.BytesIO(content)


class GenTensorVariable(tt.TensorVariable):
Expand Down
75 changes: 0 additions & 75 deletions pymc3/examples/GHME_2013.py

This file was deleted.

62 changes: 0 additions & 62 deletions pymc3/examples/LKJ_correlation.py

This file was deleted.

Empty file removed pymc3/examples/__init__.py
Empty file.
32 changes: 0 additions & 32 deletions pymc3/examples/arbitrary_stochastic.py

This file was deleted.

90 changes: 0 additions & 90 deletions pymc3/examples/arma_example.py

This file was deleted.

41 changes: 0 additions & 41 deletions pymc3/examples/baseball.py

This file was deleted.

Loading