Skip to content

Commit

Permalink
release-related tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
virgesmith committed Sep 16, 2020
1 parent 13dca11 commit 979c7ab
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 53 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include VERSION
include LICENCE
include README.md
include test/*.csv
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.5
0.0.6
8 changes: 4 additions & 4 deletions docs/citing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
```
4 changes: 2 additions & 2 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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*

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ 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",
ext_modules=ext_modules,
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,
)
2 changes: 1 addition & 1 deletion tests/benchmark.py → test/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. ],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/module.py → test/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/mpi.py → test/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
39 changes: 2 additions & 37 deletions tests/test_df.py → test/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_mpi.py → test/test_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/trans.py → test/trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 979c7ab

Please sign in to comment.