Skip to content

Commit

Permalink
doc, admin and script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
virgesmith committed Dec 11, 2017
1 parent afa515c commit 42211a3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ build/
dist/
cache/
.eggs/
tmpdata/
data/
.Rproj.user
apikey.sh
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*[this documentation refers to a non-current revision of this software and will be updated accordingly]*
*[this documentation is in the process of being updated to reflect the current codebase...]*

# Household Microsynthesis

Expand All @@ -24,9 +24,9 @@ pip3 install git+git://github.com/virgesmith/UKCensusAPI.git
```
- [humanleague](https://github.com/virgesmith/humanleague)
```
pip3 install git+git://github.com/virgesmith/humanleague.git@1.0.1
pip3 install git+git://github.com/virgesmith/humanleague.git
```
NB Ensure you install the version 1.0.1 of humanleague. Later versions have breaking changes and/or are under heavy development.
NB Ensure you install humanleague version 2 or higher - this package uses features that are not available in earlier versions.

### Installation and Testing
```
Expand All @@ -38,10 +38,11 @@ NB Ensure you install the version 1.0.1 of humanleague. Later versions have brea
```
scripts/run_microsynth.py <region(s)> <resolution>
```
where region can be a one or more local authorities (or one of England, EnglandWales, GB, UK) and resolution can be one of: LA, MSOA, LSOA, OA. If there are spaces in the former, enclose the argument in quotes, e.g.
where region can be a one or more local authorities (or one of England, EnglandWales, GB, UK), specified by either name or ONS/GSS code (e.g. E09000001). If there are spaces in the former, enclose the argument in quotes, e.g.
```
scripts/run_microsynth.py "City of London" OA
scripts/run_microsynth.py "City of London" OA11
```
Resolution can be one of: LA, MSOA11, LSOA11, OA11.

# Overview

Expand Down
9 changes: 7 additions & 2 deletions batch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

if [ ! -f ./apikey.sh ]; then
echo "api key not found. Please specify your Nomisweb API key in ./apikey.sh, e.g.:"
echo "export NOMIS_API_KEY=0x0123456789abcdef0123456789abcdef01234567"
exit 1
fi
. ./apikey.sh

source activate testenv1
Expand Down Expand Up @@ -32,11 +37,11 @@ E09000022 E09000023 E09000024 E09000025 E09000026 E09000027 E09000028 E09000029
W06000004 W06000005 W06000006 W06000008 W06000009 W06000010 W06000011 W06000012 W06000013 W06000014 W06000015 W06000016 W06000018 W06000019 W06000020 \
W06000021 W06000022 W06000023 W06000024"

resolution="OA11"

# max run time (NB Birmingham takes longest at ~6h)
qsub_params="-l h_rt=8:0:0"

resolution="OA11"

for region in $regions; do
outfile="hh_"$region"_"$resolution".csv"
if [ ! -f $outfile ]; then
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
distutils_pytest
git+git://github.com/virgesmith/humanleague.git@1.0.1
git+git://github.com/virgesmith/humanleague.git
git+git://github.com/virgesmith/UKCensusAPI.git
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():
return f.read()

setup(name='household_microsynth',
version='0.1',
version='0.0.1',
description='Household microsynthesis',
long_description=readme(),
url='https://github.com/nismod/household_microsynth',
Expand All @@ -17,7 +17,7 @@ def readme():
packages=['household_microsynth'],
zip_safe=False,
install_requires=['distutils_pytest', 'humanleague', 'ukcensusapi'],
dependency_links=['git+git://github.com/virgesmith/humanleague.git#egg=humanleague-1.0',
dependency_links=['git+git://github.com/virgesmith/humanleague.git#egg=humanleague',
'git+git://github.com/virgesmith/UKCensusAPI.git#egg=ukcensusapi'],
test_suite='nose.collector',
tests_require=['nose'],
Expand Down
18 changes: 13 additions & 5 deletions single.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/bash

# single job submission

# TODO pass (and check) args from cmd line
# single job submission - args from cmd line
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <region(s)> <resolution>"
echo e.g. $0 E09000001 OA11
exit 1
fi

region=W06000016
resolution=OA11
region=$1
resolution=$2

if [ ! -f ./apikey.sh ]; then
echo "api key not found. Please specify your Nomisweb API key in ./apikey.sh, e.g.:"
echo "export NOMIS_API_KEY=0x0123456789abcdef0123456789abcdef01234567"
exit 1
fi
. ./apikey.sh

source activate testenv1
Expand Down

0 comments on commit 42211a3

Please sign in to comment.