Skip to content

Commit d2ed38a

Browse files
authored
Rewrite conda package generation, clean up additional files. (#340)
1 parent eb5bee9 commit d2ed38a

27 files changed

+143
-408
lines changed

bld.bat .conda/bld.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"%PYTHON%" setup.py install
2-
if errorlevel 1 exit 1
1+
"%PYTHON%" setup.py install
2+
if errorlevel 1 exit 1

build.sh .conda/build.sh

File renamed without changes.

.conda/meta.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% set data = load_setup_py_data() %}
2+
3+
package:
4+
name: respy
5+
version: {{ data.get('version') }}
6+
7+
source:
8+
path: ../../respy
9+
10+
build:
11+
noarch: python
12+
13+
requirements:
14+
build:
15+
- python
16+
- setuptools
17+
18+
run:
19+
- python >=3.6,<=3.7
20+
- chaospy
21+
- click
22+
- estimagic >=0.0.27
23+
- joblib
24+
- mkl
25+
- numba >=0.42
26+
- numpy
27+
- pandas >=0.24
28+
- pytest
29+
- pyyaml
30+
- scipy
31+
test:
32+
commands:
33+
- pytest
34+
source_files:
35+
- respy
36+
- tox.ini
37+
38+
about:
39+
home: {{ data.get('url') }}
40+
license: {{ data.get('license') }}
41+
license_file: LICENSE
42+
summary: {{ data.get('description') }}
43+
dev_url: https://github.com/OpenSourceEconomics/respy
44+
doc_url: {{ data.get('url') }}

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ pytestdebug.log
1616
*.sublime-project
1717
*.sublime-workspace
1818
*.egg-info
19-
20-
**/*.pbs
21-
**/*.respy.*

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ repos:
4747
files: '(README.rst)'
4848
name: restructuredtext-lint - Is the README PyPi-compliant?
4949
# - repo: https://github.com/mgedmin/check-manifest
50-
# rev: "0.39"
50+
# rev: '0.41'
5151
# hooks:
5252
# - id: check-manifest
5353
- repo: meta

.readthedocs.yml .readthedocs.yaml

File renamed without changes.

CITATION

-20
This file was deleted.

Dockerfile

-52
This file was deleted.

LICENSE

+14-15
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ The MIT License (MIT)
22

33
Copyright (c) 2015-2020
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
6+
software and associated documentation files (the "Software"), to deal in the Software
7+
without restriction, including without limitation the rights to use, copy, modify,
8+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so, subject to the following
10+
conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all copies or
13+
substantial portions of the Software.
1414

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
OTHER DEALINGS IN THE SOFTWARE.

MANIFEST.in

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@
88

99
include CHANGES.rst
1010
include CITATION
11-
include Dockerfile
1211
include LICENSE
1312
include README.rst
1413
include tox.ini
1514
include *.sh
1615
include *.yaml
1716
include *.yml
1817

19-
graft docs
18+
graft .conda
2019
graft respy
2120

22-
prune .binder
2321
prune development
24-
prune docs/_build
25-
prune docs/getting_started/__tutorial__
22+
prune docs
2623

2724
global-exclude __pycache__
25+
global-exclude .ipynb_checkpoints
2826
global-exclude *.py[co]
2927
global-exclude *-checkpoint.ipynb

README.rst

+15
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,18 @@ You can install ``respy`` via conda with
4141
4242
Please visit our `online documentation <https://respy.readthedocs.io/en/latest/>`_ for
4343
tutorials and other information.
44+
45+
46+
Citation
47+
--------
48+
49+
If you use respy for your research, do not forget to cite it with
50+
51+
.. code-block::
52+
53+
@Unpublished{The respy Team,
54+
Title = {respy - A Framework for the Estimation of some DCDP Models.},
55+
Author = {The respy Team},
56+
Year = {2015},
57+
Url = {https://github.com/OpenSourceEconomics/respy},
58+
}

conda_build_config.yaml

-3
This file was deleted.

development/testing/regression.py

+5-23
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
import click
66
import numpy as np
77

8-
import respy as rp
98
from respy.config import TEST_RESOURCES_DIR
109
from respy.config import TOL_REGRESSION_TESTS
1110
from respy.tests.random_model import generate_random_model
12-
from respy.tests.random_model import simulate_truncated_data
13-
11+
from respy.tests.test_regression import compute_log_likelihood
12+
from respy.tests.test_regression import load_regression_tests
1413

1514
CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]}
1615

@@ -29,15 +28,6 @@ def _prepare_message(idx_failures):
2928
return subject, message
3029

3130

32-
def calc_crit_val(params, options):
33-
df = simulate_truncated_data(params, options)
34-
35-
crit_func = rp.get_crit_func(params, options, df)
36-
crit_val = crit_func(params)
37-
38-
return crit_val
39-
40-
4131
def run_regression_tests(n_tests, strict, notification):
4232
"""Run regression tests.
4333
@@ -88,20 +78,12 @@ def create_regression_tests(n_tests, save):
8878
pickle.dump(tests, p)
8979

9080

91-
def load_regression_tests():
92-
"""Load regression tests from disk."""
93-
with open(TEST_RESOURCES_DIR / "regression_vault.pickle", "rb") as p:
94-
tests = pickle.load(p)
95-
96-
return tests
97-
98-
9981
def investigate_regression_test(idx):
10082
"""Investigate regression tests."""
10183
tests = load_regression_tests()
10284
params, options, exp_val = tests[idx]
10385

104-
crit_val = calc_crit_val(params, options)
86+
crit_val = compute_log_likelihood(params, options)
10587

10688
assert np.isclose(
10789
crit_val, exp_val, rtol=TOL_REGRESSION_TESTS, atol=TOL_REGRESSION_TESTS
@@ -113,7 +95,7 @@ def _check_single(test, strict):
11395
params, options, exp_val = test
11496

11597
try:
116-
crit_val = calc_crit_val(params, options)
98+
crit_val = compute_log_likelihood(params, options)
11799
is_success = np.isclose(
118100
crit_val, exp_val, rtol=TOL_REGRESSION_TESTS, atol=TOL_REGRESSION_TESTS
119101
)
@@ -132,7 +114,7 @@ def _create_single(idx):
132114

133115
params, options = generate_random_model()
134116

135-
crit_val = calc_crit_val(params, options)
117+
crit_val = compute_log_likelihood(params, options)
136118

137119
if not isinstance(crit_val, float):
138120
raise AssertionError(" ... value of criterion function too large.")

docs/development/docker.rst

-104
This file was deleted.

0 commit comments

Comments
 (0)