diff --git a/MANIFEST.in b/MANIFEST.in index 35ce48a1..0e5d8eed 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include VERSION include LICENCE include README.md +include test/*.csv \ No newline at end of file diff --git a/README.md b/README.md index 65233cc8..066ebce7 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/neworder)](https://pypi.org/project/neworder/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/neworder)](https://pypi.org/project/neworder/) +[![DOI](https://zenodo.org/badge/111997710.svg)](https://zenodo.org/badge/latestdoi/111997710) + [![Build Status](https://travis-ci.org/virgesmith/neworder.png?branch=master)](https://travis-ci.org/virgesmith/neworder) [![Build status](https://ci.appveyor.com/api/projects/status/oycn4is2insoiun7?svg=true)](https://ci.appveyor.com/project/virgesmith/neworder) [![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT) diff --git a/VERSION b/VERSION index bbdeab62..1750564f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.5 +0.0.6 diff --git a/docs/citing.md b/docs/citing.md index 2bc23919..32492e15 100644 --- a/docs/citing.md +++ b/docs/citing.md @@ -4,11 +4,11 @@ BibTex: ```bibtex @software{neworder, - doi = { TODO... }, - author = {Andrew P. Smith}, + doi = {10.5281/zenodo.4031822}, + author = {Andrew P Smith}, year = {2020}, - version = {1.0.0}, + version = {0.0.6}, url = {https://neworder.readthedocs.io/}, - title = {neworder: A dynamic microsimulation module for python} + title = {neworder: Dynamic microsimulation in python} } ``` diff --git a/scripts/package.sh b/scripts/package.sh index 7fcd8b63..925b136d 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -5,6 +5,6 @@ version=$(cat VERSION) # package as source dist python setup.py sdist # upload -twine upload --repository-url https://test.pypi.org/legacy/ dist/neworder-$version.tar.gz -#twine upload --repository-url https://upload.pypi.org/legacy/ dist/neworder-$version* +#twine upload --repository-url https://test.pypi.org/legacy/ dist/neworder-$version.tar.gz +twine upload --repository-url https://upload.pypi.org/legacy/ dist/neworder-$version* diff --git a/setup.py b/setup.py index 9044b17f..c22e71a8 100755 --- a/setup.py +++ b/setup.py @@ -124,7 +124,7 @@ def build_extensions(self): version=version(), author='Andrew P Smith', author_email='a.p.smith@leeds.ac.uk', - url='https://github.com/virgesmith/neworder', + url='https://neworder.readthedocs.io', description='A dynamic microsimulation framework', long_description = readme(), long_description_content_type="text/markdown", @@ -132,10 +132,10 @@ def build_extensions(self): setup_requires=['pybind11>=2.5.0', 'pytest-runner'], tests_require=['pytest'], cmdclass={'build_ext': BuildExt}, - classifiers=( + classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - ), + ], zip_safe=False, ) diff --git a/tests/benchmark.py b/test/benchmark.py similarity index 97% rename from tests/benchmark.py rename to test/benchmark.py index 2d46249e..a061bd3b 100644 --- a/tests/benchmark.py +++ b/test/benchmark.py @@ -8,7 +8,7 @@ no.verbose() # define some global variables describing where the starting population and the parameters of the dynamics come from -INITIAL_POPULATION = "./tests/ssm_hh_E09000001_OA11_2011.csv" +INITIAL_POPULATION = "./ssm_hh_E09000001_OA11_2011.csv" t = np.array([ [0.9, 0.05, 0.05, 0., 0., 0. ], diff --git a/tests/correlated.py b/test/correlated.py similarity index 100% rename from tests/correlated.py rename to test/correlated.py diff --git a/tests/df.csv b/test/df.csv similarity index 100% rename from tests/df.csv rename to test/df.csv diff --git a/tests/ssm_E09000001_MSOA11_ppp_2011.csv b/test/df2.csv similarity index 100% rename from tests/ssm_E09000001_MSOA11_ppp_2011.csv rename to test/df2.csv diff --git a/tests/mc.py b/test/mc.py similarity index 100% rename from tests/mc.py rename to test/mc.py diff --git a/tests/module.py b/test/module.py similarity index 97% rename from tests/module.py rename to test/module.py index 28c1b0e2..1a5fbfd7 100644 --- a/tests/module.py +++ b/test/module.py @@ -84,13 +84,13 @@ def test(): # # DataFrame ops # modify df passing column - df = pd.read_csv("../../tests/df.csv") + df = pd.read_csv("../../test/df.csv") # modify df passing directly no.df.testfunc(model, df, "DC2101EW_C_ETHPUK11") t.check(np.array_equal(df["DC2101EW_C_ETHPUK11"].values, np.zeros(len(df)) + 3)) - df = pd.read_csv("../../tests/df.csv") + df = pd.read_csv("../../test/df.csv") cats = np.array(range(4)) transitions = np.identity(len(cats)) * 0 + 0.25 #no.log(transitions) diff --git a/tests/mpi.py b/test/mpi.py similarity index 98% rename from tests/mpi.py rename to test/mpi.py index 13ec093a..3c6d9682 100644 --- a/tests/mpi.py +++ b/test/mpi.py @@ -41,7 +41,7 @@ def test(): neworder.log("MPI: 0 sent {}={} 1 recd {}={}".format(type(x), x, type(y), y)) t.check(np.array_equal(x,y)) - df = pd.read_csv("../../tests/ssm_E09000001_MSOA11_ppp_2011.csv") + df = pd.read_csv("../../test/df2.csv") if neworder.mpi.rank() == 0: neworder.log("sending (as csv) df len %d rows from 0" % len(df)) neworder.mpi.send_csv(df, 1) diff --git a/tests/op.py b/test/op.py similarity index 100% rename from tests/op.py rename to test/op.py diff --git a/tests/test.py b/test/test.py similarity index 100% rename from tests/test.py rename to test/test.py diff --git a/tests/test_df.py b/test/test_df.py similarity index 72% rename from tests/test_df.py rename to test/test_df.py index 146b73cb..393e2cd5 100644 --- a/tests/test_df.py +++ b/test/test_df.py @@ -10,7 +10,7 @@ def test_errors(): - df = pd.read_csv("./tests/df.csv") + df = pd.read_csv("./test/df.csv") # base model for MC engine model = no.Model(no.Timeline.null(), no.MonteCarlo.deterministic_identical_stream) @@ -83,7 +83,7 @@ def test_basic(): def test(): - df = pd.read_csv("./tests/df.csv") + df = pd.read_csv("./test/df.csv") # base model for MC engine model = no.Model(no.Timeline.null(), no.MonteCarlo.deterministic_identical_stream) @@ -113,38 +113,3 @@ def test(): assert np.array_equal(np.sort(df["DC2101EW_C_ETHPUK11"].unique()), np.array([0, 3])) -# def todo(): - -# # define some global variables describing where the starting population and the parameters of the dynamics come from -# initial_population = "examples/households/data/ssm_hh_E09000001_OA11_2011.csv" - -# hh = pd.read_csv(initial_population) - -# print(hh.columns.values) -# c = hh.LC4408_C_AHTHUK11.unique() -# print(c) -# t = np.identity(len(c)) - -# # [ 3 5 1 2 -1 4] -# t = np.array([[0.9, 0.05, 0.05, 0.0, 0.0, 0.0], -# [0.05, 0.9, 0.04, 0.01, 0.0, 0.0], -# [0.0, 0.05, 0.9, 0.05, 0.0, 0.0], -# [0.0, 0.0, 0.05, 0.9, 0.05, 0.0], -# [0.1, 0.1, 0.1, 0.1, 0.5, 0.1], -# [0.0, 0.0, 0.00, 0.0, 0.2, 0.8]]) - -# #print(t[1]) # horz -# #print(t[:,1]) # vert -# tc = np.cumsum(t, axis=1) -# # TODO timing... -# u = np.random.sample(len(hh)) -# for i in range(len(hh)): -# current = hh.loc[i, "LC4408_C_AHTHUK11"] -# hh.loc[i, "LC4408_C_AHTHUK11"] = sample(u[i], tc[current], c) - -# print(hh.LC4408_C_AHTHUK11.head()) - -# tc = np.cumsum(t, axis=1) - -# print(np.cumsum(t[1])) -# #print() \ No newline at end of file diff --git a/tests/test_mc.py b/test/test_mc.py similarity index 100% rename from tests/test_mc.py rename to test/test_mc.py diff --git a/tests/test_model.py b/test/test_model.py similarity index 100% rename from tests/test_model.py rename to test/test_model.py diff --git a/tests/test_module.py b/test/test_module.py similarity index 100% rename from tests/test_module.py rename to test/test_module.py diff --git a/tests/test_mpi.py b/test/test_mpi.py similarity index 97% rename from tests/test_mpi.py rename to test/test_mpi.py index d5f4fb08..86220f1a 100644 --- a/tests/test_mpi.py +++ b/test/test_mpi.py @@ -40,7 +40,7 @@ def test_arrays(): y = comm.recv(source=0) assert np.array_equal(x,y) - df = pd.read_csv("./tests/ssm_E09000001_MSOA11_ppp_2011.csv") + df = pd.read_csv("./test/df2.csv") if no.mpi.rank() == 0: comm.send(df, dest=1) if no.mpi.rank() == 1: diff --git a/tests/test_timeline.py b/test/test_timeline.py similarity index 100% rename from tests/test_timeline.py rename to test/test_timeline.py diff --git a/tests/test_wrapper.py b/test/test_wrapper.py similarity index 100% rename from tests/test_wrapper.py rename to test/test_wrapper.py diff --git a/tests/trans.py b/test/trans.py similarity index 98% rename from tests/trans.py rename to test/trans.py index a7d50fc1..a2588560 100644 --- a/tests/trans.py +++ b/test/trans.py @@ -14,7 +14,7 @@ def test(): t = test_.Test() - df = pd.read_csv("../../tests/df.csv") + df = pd.read_csv("../../test/df.csv") # base model for MC engine model = no.Model(no.Timeline.null(), no.MonteCarlo.deterministic_identical_stream)