Skip to content

Commit

Permalink
Merge pull request #387 from dapugacheva/main
Browse files Browse the repository at this point in the history
Jupyter Lab and Software set up on GitHub adjustments from issue #375
  • Loading branch information
carlhiggs authored Mar 19, 2024
2 parents ac82434 + 457a3a3 commit fbb9697
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
7 changes: 5 additions & 2 deletions process/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"- Analyses could be conducted for different time points using historical data\n",
"- Finally, data could be modified to represent hypothetical interventions and evaluate their impact on the calculated indicators\n",
"\n",
"To run the following analysis, copy the file `process/configuration/example_ES_Las_Palmas.yml` to a new file named `example_ES_Las_Palmas_test_not_urbanx.yml`. Open this in a text editor and replace the `ghsl_urban_intersection: true` in the study region boundary to read `ghsl_urban_intersection: false`."
"To run the following analysis, copy the file `process/configuration/regions/example_ES_Las_Palmas.yml` to a new file named `example_ES_Las_Palmas_test_not_urbanx.yml`. Open this in a text editor and replace the `ghsl_urban_intersection: true` in the study region boundary to read `ghsl_urban_intersection: false`."
]
},
{
Expand Down Expand Up @@ -325,6 +325,9 @@
" field='local_walkability',\n",
" layer=r.config['grid_summary'],\n",
" id='grid_id',\n",
" fill_color='YlGn',\n",
" fill_opacity=0.7,\n",
" line_opacity=0.1,\n",
" title='Local walkability',\n",
" attribution='Global Healthy and Sustainable City Indicators Collaboration'\n",
")\n",
Expand All @@ -345,7 +348,7 @@
"\n",
"![image.png](attachment:01efeb07-053e-48bb-8e5b-736962ab54b9.png)\n",
"\n",
"In the interactive version, you can hover over grid cells to view the value of the specified indicator for that location."
"In the interactive version, you can hover over grid cells to view the value of the specified indicator for that location. You can change graphic parameters like fill color, see [how to choose colormaps in matplotlib](https://matplotlib.org/stable/users/explain/colors/colormaps.html#classes-of-colormaps)"
]
},
{
Expand Down
13 changes: 11 additions & 2 deletions process/subprocesses/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,9 @@ def plot_choropleth_map(
field: str,
layer: str = 'indicators_grid_100m',
layer_id: str = 'grid_id',
fill_color: str = 'YlGn',
fill_opacity: float = 0.7,
line_opacity: float = 0.1,
title: str = '',
attribution: str = '',
):
Expand All @@ -1592,6 +1595,9 @@ def plot_choropleth_map(
boundary_centroid=tuple(r.get_centroid()),
key_on=layer_id,
fields=[layer_id, field],
fill_color=fill_color,
fill_opacity=fill_opacity,
line_opacity=line_opacity,
title=title,
attribution=attribution,
)
Expand All @@ -1604,6 +1610,9 @@ def choropleth_map(
key_on: str,
fields: list,
boundary_centroid: tuple,
fill_color: str,
fill_opacity: float,
line_opacity: float,
title: str,
attribution: str,
):
Expand Down Expand Up @@ -1647,8 +1656,8 @@ def choropleth_map(
key_on=f'feature.properties.{key_on}',
name='choropleth',
columns=fields,
fill_color='YlGn',
fill_opacity=0.7,
fill_color=fill_color,
fill_opacity=fill_opacity,
line_opacity=0.1,
legend_name=title,
).add_to(m)
Expand Down
6 changes: 6 additions & 0 deletions process/subprocesses/ghsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,9 @@ def choropleth(
field: str,
layer: str,
id: str,
fill_color: str,
fill_opacity: float,
line_opacity: float,
title: str,
save=True,
attribution: str = 'Global Healthy and Sustainable City Indicators Collaboration',
Expand All @@ -971,6 +974,9 @@ def choropleth(
layer=layer,
layer_id=id,
title=title,
fill_color=fill_color,
fill_opacity=fill_opacity,
line_opacity=line_opacity,
attribution=attribution,
)
if save:
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ As an example of a sensitivity analysis of the urban boundary used for analysis:

![image](https://github.com/global-healthy-liveable-cities/global-indicators/assets/12984626/c95e1ab4-3d89-49a6-86cb-61718f83dde5)

### Exit the software
To exit the web application click the **exit** button in the top right-hand corner. At the end of a Jupyter session, in the menu click _File > Shut Down_. If you close a browser window with the Jupyter Lab or GHSCI app still running, the underlying server process running these may be interrupted by pressing `Control+C` at the command prompt.

To run the analysis for your study region visit our website for detailed instructions on how to configure [a new study region](https://global-healthy-liveable-cities.github.io/software/#Details) and what [input data is required](https://global-healthy-liveable-cities.github.io/software/#Data).

## Citations

The software was developed by the [Global Healthy and Sustainable City Indicators Collaboration](https://www.healthysustainablecities.org/about#team) team, an international partnership of researchers and practitioners, extending methods developed by the [Healthy Liveable Cities Lab](https://cur.org.au/research-programs/healthy-liveable-cities-group/) at RMIT University and incorporating functionality from the [OSMnx](https://github.com/gboeing/osmnx) tool developed by Geoff Boeing.
Expand Down

0 comments on commit fbb9697

Please sign in to comment.