Skip to content

Commit b07503f

Browse files
committed
update some references
1 parent 2fb24cc commit b07503f

File tree

5 files changed

+59
-75
lines changed

5 files changed

+59
-75
lines changed

README.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,18 @@ A technical memorandum describing DEMOS is available [here](./DEMOS_Technical_Me
1818
### Docker Compose (recommended)
1919
The latest docker image for demos is stored in `ghcr.io/NatLabRockies/demos:latest`. The input data and configuration file are fed to the container through volumes ([more info about Docker volumes](https://docs.docker.com/engine/storage/volumes/)). We provide a `docker-compose` workflow that can be used to make the process of mounting volumes easier.
2020

21-
#### Prepare the configuration file and data folder
21+
#### Clone this repository
22+
By cloning this repository you download the configuration and data for an example run of DEMOS.
2223

2324
Run the following command in the Terminal App (MacOS) or Command Prompt/PowerShell (Windows):
24-
2525
```bash
26-
# Create a directory where to run DEMOS from
27-
mkdir demos
28-
cd demos
29-
30-
# Create the configuration folder and retrieve an example configuration
31-
mkdir configuration
32-
cd configuration
33-
curl -L -o demos_config.toml https://raw.githubusercontent.com/NatLabRockies/DEMOS/main/configuration/demos_config_small_example.toml
34-
35-
# Create the data folder for the output to be stored
36-
cd ..
37-
mkdir data
38-
# Populate the data folder
39-
40-
# Finally, retrieve the docker-compose.yml file
41-
curl -L -o docker-compose.yml https://raw.githubusercontent.com/NatLabRockies/DEMOS/main/docker-compose.yml
26+
git clone https://github.com/NatLabRockies/DEMOS.git
27+
28+
# Move into the project folder
29+
cd DEMOS
30+
31+
# This folder contains (among other files) a data and configuration folder
32+
# as well as a docker-compose.yml file
4233
```
4334

4435
Make sure you have [Docker](https://docs.docker.com/desktop/) and [Docker Compose](https://docs.docker.com/compose/install/) installed. Now you can run docker as follows:

configuration/demos_config.toml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
random_seed = 100
33
base_year = 2010
44
forecast_year = 2019
5-
calibrated_models_dir = "../data/sf_bay_example/calibrated_models_coefficients/"
5+
calibrated_models_dir = "../data/small_example/calibrated_models_coefficients/"
66
inconsistent_persons_table_behavior = "fix"
77
modules = [
88
"aging",
@@ -26,38 +26,40 @@ initialize_empty_tables = [
2626
"rebalanced_households"
2727
]
2828

29+
2930
# Data sources
31+
3032
## Synthetic population data
3133
[[tables]]
3234
file_type = "h5"
3335
table_name = "persons"
34-
filepath = "../data/sf_bay_example/custom_mpo_06197001_model_data.h5"
36+
filepath = "../data/small_example/small_example_tables.h5" # custom_mpo_06197001_model_data_small.h5, minihh.h5, custom_mpo_06197001_model_data_small_stratHH.h5, custom_mpo_06197001_model_data_hh0.05.h5, countyNM.h5
3537
h5_key = "persons"
3638

3739
[[tables]]
3840
file_type = "h5"
3941
table_name = "households"
40-
filepath = "../data/sf_bay_example/custom_mpo_06197001_model_data.h5"
42+
filepath = "../data/small_example/small_example_tables.h5" # custom_mpo_06197001_model_data_small.h5, minihh.h5, custom_mpo_06197001_model_data_hh0.05.h5, custom_mpo_06197001_model_data_county1, countyNM.h5
4143
h5_key = "households"
4244

4345
## Other static data tables
4446
[[tables]]
4547
file_type = "csv"
4648
table_name = "relational_adjustment_mapping"
47-
filepath = "../data/sf_bay_example/relmap_06197001.csv"
49+
filepath = "../data/small_example/relmap_06197001.csv"
4850
index_col = "index"
4951

5052
[[tables]]
5153
file_type = "csv"
5254
table_name = "income_rates"
53-
filepath = "../data/sf_bay_example/observed_calibration_values/income_rates_06197001.csv"
55+
filepath = "../data/small_example/observed_calibration_values/income_rates_06197001.csv"
5456
index_col = "year"
5557
custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "rate" = "float"}
5658

5759
[[tables]]
5860
file_type = "csv"
5961
table_name = "hsize_ct"
60-
filepath = "../data/sf_bay_example/observed_calibration_values/hsize_ct_06197001.csv"
62+
filepath = "../data/small_example/observed_calibration_values/hsize_ct_06197001_4155.csv"
6163
index_col = "year"
6264
custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "hh_size" = "object", "total_number_of_households" = "int"}
6365

@@ -67,13 +69,13 @@ custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "hh_size" =
6769
[[tables]]
6870
file_type = "csv"
6971
table_name = "observed_employment"
70-
filepath = "../data/sf_bay_example/observed_calibration_values/employment_obs.csv"
72+
filepath = "../data/small_example/observed_calibration_values/employment_obs_county.csv"
7173
index_col = "year"
7274

7375
[[tables]]
7476
file_type = "csv"
7577
table_name = "observed_marrital_data"
76-
filepath = "../data/sf_bay_example/observed_calibration_values/marrital_status_over_time_obs.csv"
78+
filepath = "../data/small_example/observed_calibration_values/marrital_status_over_time_obs_county.csv"
7779
index_col = "year"
7880

7981

@@ -88,24 +90,24 @@ momentum_weight = 0.3
8890
[mortality_module_config.calibration_procedure]
8991
procedure_type = "rmse_error"
9092
tolerance_type = "absolute"
91-
tolerance = 1000
92-
max_iter = 1000
93+
tolerance = 30
94+
max_iter = 500
9395
[mortality_module_config.calibration_procedure.observed_values_table]
9496
file_type = "csv"
9597
table_name = "observed_fatalities_data"
96-
filepath = "../data/sf_bay_example/observed_calibration_values/mortalities_over_time_obs.csv"
98+
filepath = "../data/small_example/observed_calibration_values/mortalities_over_time_obs_county2.csv"
9799
index_col = "year"
98100

99101
## Birth
100102
[birth_module_config.calibration_procedure]
101103
procedure_type = "rmse_error"
102104
tolerance_type = "absolute"
103-
tolerance = 1000
105+
tolerance = 60 # lower
104106
max_iter = 1000
105107
[birth_module_config.calibration_procedure.observed_values_table]
106108
file_type = "csv"
107109
table_name = "observed_births_data"
108-
filepath = "../data/sf_bay_example/observed_calibration_values/births_over_time_obs.csv"
110+
filepath = "../data/small_example/observed_calibration_values/births_over_time_obs_county2.csv"
109111
index_col = "year"
110112

111113
## HH Reorg
@@ -115,7 +117,7 @@ geoid_col = "lcm_county_id"
115117
[hh_reorg_module_config.simultaneous_calibration_config]
116118
tolerance = 5_000
117119
max_iter = 100
118-
learning_rate = 2.5
120+
learning_rate = 1.5
119121
momentum_weight = 0.3
120122

121123
## HH Rebalancing
@@ -128,6 +130,5 @@ geoid_col = "lcm_county_id"
128130
[kids_moving_module_config]
129131
geoid_col = "lcm_county_id"
130132
calibration_target_share = 0.12
131-
calibration_tolerance = 0.001
132-
133-
133+
calibration_tolerance = 0.01
134+
max_iter = 100

configuration/demos_config_small_example.toml renamed to configuration/demos_config_ref.toml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
random_seed = 100
33
base_year = 2010
44
forecast_year = 2019
5-
calibrated_models_dir = "../data/small_example/calibrated_models_coefficients/"
5+
calibrated_models_dir = "../data/sf_bay_example/calibrated_models_coefficients/"
66
inconsistent_persons_table_behavior = "fix"
77
modules = [
88
"aging",
@@ -26,40 +26,38 @@ initialize_empty_tables = [
2626
"rebalanced_households"
2727
]
2828

29-
3029
# Data sources
31-
3230
## Synthetic population data
3331
[[tables]]
3432
file_type = "h5"
3533
table_name = "persons"
36-
filepath = "../data/small_example/small_example_tables.h5" # custom_mpo_06197001_model_data_small.h5, minihh.h5, custom_mpo_06197001_model_data_small_stratHH.h5, custom_mpo_06197001_model_data_hh0.05.h5, countyNM.h5
34+
filepath = "../data/sf_bay_example/custom_mpo_06197001_model_data.h5"
3735
h5_key = "persons"
3836

3937
[[tables]]
4038
file_type = "h5"
4139
table_name = "households"
42-
filepath = "../data/small_example/small_example_tables.h5" # custom_mpo_06197001_model_data_small.h5, minihh.h5, custom_mpo_06197001_model_data_hh0.05.h5, custom_mpo_06197001_model_data_county1, countyNM.h5
40+
filepath = "../data/sf_bay_example/custom_mpo_06197001_model_data.h5"
4341
h5_key = "households"
4442

4543
## Other static data tables
4644
[[tables]]
4745
file_type = "csv"
4846
table_name = "relational_adjustment_mapping"
49-
filepath = "../data/small_example/relmap_06197001.csv"
47+
filepath = "../data/sf_bay_example/relmap_06197001.csv"
5048
index_col = "index"
5149

5250
[[tables]]
5351
file_type = "csv"
5452
table_name = "income_rates"
55-
filepath = "../data/small_example/observed_calibration_values/income_rates_06197001.csv"
53+
filepath = "../data/sf_bay_example/observed_calibration_values/income_rates_06197001.csv"
5654
index_col = "year"
5755
custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "rate" = "float"}
5856

5957
[[tables]]
6058
file_type = "csv"
6159
table_name = "hsize_ct"
62-
filepath = "../data/small_example/observed_calibration_values/hsize_ct_06197001_4155.csv"
60+
filepath = "../data/sf_bay_example/observed_calibration_values/hsize_ct_06197001.csv"
6361
index_col = "year"
6462
custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "hh_size" = "object", "total_number_of_households" = "int"}
6563

@@ -69,13 +67,13 @@ custom_dtype_casting = {"lcm_county_id" = "object", "year" = "int", "hh_size" =
6967
[[tables]]
7068
file_type = "csv"
7169
table_name = "observed_employment"
72-
filepath = "../data/small_example/observed_calibration_values/employment_obs_county.csv"
70+
filepath = "../data/sf_bay_example/observed_calibration_values/employment_obs.csv"
7371
index_col = "year"
7472

7573
[[tables]]
7674
file_type = "csv"
7775
table_name = "observed_marrital_data"
78-
filepath = "../data/small_example/observed_calibration_values/marrital_status_over_time_obs_county.csv"
76+
filepath = "../data/sf_bay_example/observed_calibration_values/marrital_status_over_time_obs.csv"
7977
index_col = "year"
8078

8179

@@ -90,24 +88,24 @@ momentum_weight = 0.3
9088
[mortality_module_config.calibration_procedure]
9189
procedure_type = "rmse_error"
9290
tolerance_type = "absolute"
93-
tolerance = 30
94-
max_iter = 500
91+
tolerance = 1000
92+
max_iter = 1000
9593
[mortality_module_config.calibration_procedure.observed_values_table]
9694
file_type = "csv"
9795
table_name = "observed_fatalities_data"
98-
filepath = "../data/small_example/observed_calibration_values/mortalities_over_time_obs_county2.csv"
96+
filepath = "../data/sf_bay_example/observed_calibration_values/mortalities_over_time_obs.csv"
9997
index_col = "year"
10098

10199
## Birth
102100
[birth_module_config.calibration_procedure]
103101
procedure_type = "rmse_error"
104102
tolerance_type = "absolute"
105-
tolerance = 60 # lower
103+
tolerance = 1000
106104
max_iter = 1000
107105
[birth_module_config.calibration_procedure.observed_values_table]
108106
file_type = "csv"
109107
table_name = "observed_births_data"
110-
filepath = "../data/small_example/observed_calibration_values/births_over_time_obs_county2.csv"
108+
filepath = "../data/sf_bay_example/observed_calibration_values/births_over_time_obs.csv"
111109
index_col = "year"
112110

113111
## HH Reorg
@@ -117,7 +115,7 @@ geoid_col = "lcm_county_id"
117115
[hh_reorg_module_config.simultaneous_calibration_config]
118116
tolerance = 5_000
119117
max_iter = 100
120-
learning_rate = 1.5
118+
learning_rate = 2.5
121119
momentum_weight = 0.3
122120

123121
## HH Rebalancing
@@ -130,5 +128,6 @@ geoid_col = "lcm_county_id"
130128
[kids_moving_module_config]
131129
geoid_col = "lcm_county_id"
132130
calibration_target_share = 0.12
133-
calibration_tolerance = 0.01
134-
max_iter = 100
131+
calibration_tolerance = 0.001
132+
133+
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Default Configuration File
22
==========================
33

4-
This page shows the default `demos_config.toml`
4+
This page shows the default `demos_config_ref.toml`
55

6-
.. literalinclude:: ../../../configuration/demos_config.toml
6+
.. literalinclude:: ../../../configuration/demos_config_ref.toml
77
:language: toml
88
:linenos:
9-
:caption: Default configuration (`demos_config.toml`)
9+
:caption: Default configuration (`demos_config_ref.toml`)

docs/source/pages/intro.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,26 @@ This document summarizes instructions to install, configure and run DEMOS. Secti
2828
### Docker Compose (recommended)
2929
The latest docker image for demos is stored in `ghcr.io/NatLabRockies/demos:latest`. The input data and configuration file are fed to the container through volumes ([more info about Docker volumes](https://docs.docker.com/engine/storage/volumes/)). We provide a `docker-compose` workflow that can be used to make the process of mounting volumes easier.
3030

31-
#### Prepare the configuration file and data folder
31+
#### Clone this repository
32+
By cloning this repository you download the configuration and data for an example run of DEMOS.
3233

3334
Run the following command in the Terminal App (MacOS) or Command Prompt/PowerShell (Windows):
34-
3535
```bash
36-
# Create a directory where to run DEMOS from
37-
mkdir demos
38-
cd demos
39-
40-
# Create the configuration folder and retrieve an example configuration
41-
mkdir configuration
42-
cd configuration
43-
curl -L -o demos_config.toml https://raw.githubusercontent.com/NatLabRockies/DEMOS/main/configuration/demos_config_small_example.toml
44-
45-
# Create the data folder for the output to be stored
46-
cd ..
47-
mkdir data
48-
# Populate the data folder
49-
50-
# Finally, retrieve the docker-compose.yml file
51-
curl -L -o docker-compose.yml https://raw.githubusercontent.com/NatLabRockies/DEMOS/main/docker-compose.yml
36+
git clone https://github.com/NatLabRockies/DEMOS.git
37+
38+
# Move into the project folder
39+
cd DEMOS
40+
41+
# This folder contains (among other files) a data and configuration folder
42+
# as well as a docker-compose.yml file
5243
```
5344

54-
Now you can run docker as follows:
45+
Make sure you have [Docker](https://docs.docker.com/desktop/) and [Docker Compose](https://docs.docker.com/compose/install/) installed. Now you can run docker as follows:
46+
5547
```bash
5648
docker compose up
5749
```
50+
5851
> **Note:**
5952
> Make sure the Docker Daemon is running. This changes from system to system but Docker Desktop should have a status flag indicating if the daemon is live, if Desktop is available
6053

0 commit comments

Comments
 (0)