Skip to content

Commit

Permalink
updated docker file (and associated version numbers, incremented to 4…
Browse files Browse the repository at this point in the history
….4.5, and Docker image) to address #336 and updated test.py to address #337
  • Loading branch information
carlhiggs committed Jul 4, 2023
1 parent 7142631 commit 07efb3a
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .ghsci_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.3
4.4.5
2 changes: 1 addition & 1 deletion .test-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
ghsci:
image: globalhealthyliveablecities/global-indicators:v4.4.2
image: globalhealthyliveablecities/global-indicators:v4.4.5
container_name: ghsci
shm_size: 2g
stdin_open: true # docker run -i
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
ghsci:
image: globalhealthyliveablecities/global-indicators:v4.4.2
image: globalhealthyliveablecities/global-indicators:v4.4.5
container_name: ghsci
shm_size: 2g
stdin_open: true # docker run -i
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RUN mkdir /env && \
ENV PATH="/env/bin/:$PATH"
ENV PROJ_LIB="/env/share/proj"

RUN echo 'alias configure="python configure.py"' >> ~/.bashrc && \
RUN pip install -e git+https://github.com/wklumpen/gtfs-lite.git#egg=gtfs-lite && \
echo 'alias configure="python configure.py"' >> ~/.bashrc && \
echo 'alias analysis="python analysis.py"' >> ~/.bashrc && \
echo 'alias generate="python generate.py"' >> ~/.bashrc && \
echo 'alias compare="python compare.py"' >> ~/.bashrc && \
Expand Down
6 changes: 2 additions & 4 deletions docker/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ channels:
- conda-forge
dependencies:
- python
- osmnx=1.4.* # for constructing network graph from OpenStreetMap using Overpass API
- osmnx=1.5.* # for constructing network graph from OpenStreetMap using Overpass API
- fpdf2=2.7.*
- sqlalchemy=1.4.*
- nicegui=1.2.23
- nicegui>=1.2.24
- cryptography=41.0.*
- requests=2.31.*
- tornado>=6.3.2
Expand All @@ -27,5 +27,3 @@ dependencies:
- pyyaml
- websockets
- pip
- pip:
- gtfs-lite
31 changes: 16 additions & 15 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ beautifulsoup4==4.12.2
bidict==0.22.1
bleach==6.0.0
branca==0.6.0
Brotli==1.0.9
Cartopy==0.21.1
certifi==2023.5.7
cffi==1.15.1
Expand All @@ -34,7 +35,7 @@ decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
et-xmlfile==1.1.0
exceptiongroup==1.1.1
exceptiongroup==1.1.2
executing==1.2.0
fastapi==0.92.0
fastapi-socketio==0.0.10
Expand All @@ -55,14 +56,14 @@ h11==0.14.0
idna==3.4
importlib-metadata==6.7.0
importlib-resources==5.12.0
ipykernel==6.23.3
ipykernel==6.24.0
ipython==8.14.0
ipywidgets==8.0.6
itsdangerous==2.1.2
jedi==0.18.2
Jinja2==3.1.2
joblib==1.2.0
json5==0.9.5
joblib==1.3.0
json5==0.9.14
jsonschema==4.17.3
jupyter_client==8.3.0
jupyter_core==5.3.1
Expand All @@ -78,14 +79,14 @@ kiwisolver==1.4.4
libpysal==4.7.0
lxml==4.9.2
mapclassify==2.5.0
markdown2==2.4.8
markdown2==2.4.9
MarkupSafe==2.1.3
matplotlib==3.7.1
matplotlib-inline==0.1.6
mercantile==1.2.1
mistune==3.0.0
momepy==0.0.0
munch==3.0.0
munch==4.0.0
munkres==1.1.4
nbclient==0.8.0
nbconvert==7.6.0
Expand All @@ -98,17 +99,17 @@ numexpr==2.8.4
numpy==1.25.0
openpyxl==3.1.2
orjson==3.8.14
osmnx==1.4.0
osmnx==1.5.0
overrides==7.3.1
OWSLib==0.29.2
packaging==23.1
pandana==0.6.1
pandas==2.0.2
pandas==2.0.3
pandocfilters==1.5.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.5.0
Pillow==10.0.0
pip==23.1.2
pkgutil_resolve_name==1.3.10
platformdirs==3.8.0
Expand All @@ -123,7 +124,7 @@ ptyprocess==0.7.0
pure-eval==0.2.2
py-cpuinfo==9.0.0
pycparser==2.21
pydantic==1.10.9
pydantic==1.10.10
pygeometa==0.15.0
pygeos==0.14
Pygments==2.15.1
Expand All @@ -143,21 +144,21 @@ python-socketio==5.8.0
pytz==2023.3
PyYAML==6.0
pyzmq==25.1.0
rasterio==1.3.7
rasterio==1.3.8
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
Rtree==1.0.1
scikit-learn==1.2.2
scipy==1.11.0
scikit-learn==1.3.0
scipy==1.11.1
Send2Trash==1.8.2
setuptools==68.0.0
shapely==2.0.1
six==1.16.0
sniffio==1.3.0
snuggs==1.4.7
soupsieve==2.3.2.post1
SQLAlchemy==1.4.46
SQLAlchemy==1.4.48
stack-data==0.6.2
starlette==0.25.0
tables==3.8.0
Expand All @@ -169,7 +170,7 @@ tomli==2.0.1
tornado==6.3.2
tqdm==4.65.0
traitlets==5.9.0
typing_extensions==4.6.3
typing_extensions==4.7.1
typing-utils==0.1.0
tzdata==2023.3
unicodedata2==15.0.0
Expand Down
37 changes: 36 additions & 1 deletion process/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import unittest

try:
import subprocesses.ghsci
from subprocesses import ghsci

project_setup = True
except ImportError as e:
Expand All @@ -45,6 +45,41 @@ def test_project_setup(self):
"""Check if _project_setup.py imported successfully."""
self.assertTrue(project_setup)

def test_load_example_region(self):
"""Load example region."""
codename = 'example_ES_Las_Palmas_2023'
r = ghsci.Region(codename)

def test_example_analysis(self):
"""Analyse example region."""
codename = 'example_ES_Las_Palmas_2023'
r = ghsci.Region(codename)
r.analysis()

def test_example_generate(self):
"""Generate resources for example region."""
codename = 'example_ES_Las_Palmas_2023'
r = ghsci.Region(codename)
r.generate()

def test_sensitivity(self):
"""Test sensitivity analysis of urban intersection parameter."""
reference = 'example_ES_Las_Palmas_2023'
comparison = 'ES_Las_Palmas_2023_test_not_urbanx'
# create modified version of reference configuration
with open(f'./configuration/regions/{reference}.yml') as file:
configuration = file.read()
configuration = configuration.replace(
'ghsl_urban_intersection: true',
'ghsl_urban_intersection: false',
)
with open(f'./configuration/regions/{comparison}.yml', 'w') as file:
file.write(configuration)
r = ghsci.Region(comparison)
r.analysis()
r.generate()
r.compare(reference, comparison)


def calculate_line_endings(path):
"""
Expand Down

0 comments on commit 07efb3a

Please sign in to comment.