Skip to content

Commit fdcb11f

Browse files
committed
small update to README
1 parent b2c35a5 commit fdcb11f

File tree

1 file changed

+32
-58
lines changed

1 file changed

+32
-58
lines changed

README.md

Lines changed: 32 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![Docs](https://github.com/NREL/DEMOS_NREL/actions/workflows/docs.yml/badge.svg)](https://nrel.github.io/DEMOS_NREL/)
44

5-
>**TODO:** The previous description from Urbansim it outdated. Add description of DEMOS, aligning with the code (paper).
65

76
## Usage
87
### Docker Container
@@ -13,7 +12,7 @@ For running the `docker-compose` workflow:
1312
DEMOS_CONFIG_PATH=<path-to-config> DEMOS_DATA_DIR=<path-to-data-dir> docker-compose up
1413
```
1514

16-
By default `DEMOS_CONFIG_PATH` is set to `./demos_config.toml` and `DEMOS_DATA_DIR` is set to `./data`, so if `data` and `demos_config.toml` are part of the cuurent directory, no additional input is needed.
15+
By default `DEMOS_CONFIG_PATH` is set to `./demos_config.toml` and `DEMOS_DATA_DIR` is set to `./data`, so if `data` and `demos_config.toml` are part of the current directory, no additional input is needed.
1716

1817
Alternatively,
1918
```bash
@@ -28,79 +27,54 @@ Docker imposes a global limit on how much RAM containers can allocate. DEMOS eas
2827
docker build -t demos:0.0.1 --platform=linux/amd64 -f Dockerfile .
2928
```
3029

31-
### From Source
3230

33-
This repository contains only code and configuration/setup files necessary
34-
35-
36-
1. clone this repository into your local machine
37-
38-
2. create environment if needed
3931

32+
1. Clone this repository
4033
```
41-
conda create --name {myenv} python=3.8
34+
git clone https://github.com/NREL/DEMOS_NREL.git
4235
```
4336

44-
3. Enter into DEMOS environment
37+
1. Create a virtual environment.
4538

39+
**If using conda**, prefer the provided `.lock` files
4640
```
47-
conda activate {myenv}
41+
conda create --name demos-env --file conda-{system}.lock
4842
```
4943

50-
4. Install all packages if needed
51-
44+
Alternatively, create a `python 3.10` environment and install dependencies
5245
```
53-
pip install -r requirements.txt
46+
conda create -n demos-env python=3.10
47+
conda activate demos-env
48+
pip install .
5449
```
5550

56-
5. Download input data [data_nrel.zip](https://app.box.com/s/tox2nflumia2g4n6rk2i0navca9pskep). You may also refer to the data description [here](https://cloud.urbansim.com/docs/general/documentation/urbansim%20block%20model%20data.html)
51+
## Running DEMOS
5752

58-
6. Put all files of input data into `DEMOS_NREL/demos/data`
53+
DEMOS requires a series of input tables. Example tables are provided [here](https://app.box.com/s/tox2nflumia2g4n6rk2i0navca9pskep) for internal NREL use. It is recommended to store all the input values in the folder `data` in root of the project, but absolute values can be used by specifying them in the configuration file. You may also refer to the data description [here](https://cloud.urbansim.com/docs/general/documentation/urbansim%20block%20model%20data.html)
5954

60-
7. Run DEMOS. First, enter into `DEMOS_NREL/demos`, then run:
55+
To run demos:
56+
```
57+
python simulate.py -cfg {configuration_file}
58+
```
6159

62-
```
63-
python -u simulate.py -c -y 2011 -cf custom -l -r 06197001 -s 100
64-
```
6560

66-
the following are the arguments used in the above command:
67-
```
68-
-r region_code, --region_code region_code
69-
region fips code
70-
-y year, --year year forecast year to simulate to
71-
-c, --calibrated whether to run with calibrated coefficients
72-
-cf calibrated_folder, --calibrated_folder calibrated_folder
73-
name of the calibration folder to read configs from
74-
-sg, --segmented run with segmented lcms
75-
-l, --all_local no cloud access whatsoever
76-
-i input_year, --input_year input_year
77-
input data (base) year
78-
-f freq_interval, --freq_interval freq_interval
79-
intra-simulation frequency interval
80-
-o output_fname, --output_fname output_fname
81-
output file name
82-
-ss skim_source, --skim_source skim_source
83-
skims format, e.g. "beam", "polaris"
84-
-rm, --random_matching random matching in the single to x model to
85-
reduce computational time due to
86-
the matchmaking process
87-
-s --random_seed random seed settng
88-
```
8961

90-
8. simulation results
91-
the demos simulation will produce the following sets of data and results:
92-
- a synthetic population file showing the evolution of the synthetic population throughout the simulation years. the file should be named `model_data_<scenario_name_output_year>.h5` in directory `DEMOS_NREL/demos/data`.
93-
- series of aggregated statistics for the population size, number of households, household size distribution, gender distribution, number of births, number of mortalities, number of student enrollments, number of total marriages, number of total divorces, the age distribution of the synthetic population, and income distribution for each simulation year. The files are located at `DEMOS_NREL/demos/outputs/simulation`
62+
A default configuration file is provided in `configuration/demos_config.toml`. The `[[tables]]` entries outline tables to be loaded. For example, we can load the `persons` and `households` table from an H5 source:
9463

95-
### ii. project structure
96-
>**TODO:** this part still need to be complemented
64+
```toml
65+
[[tables]]
66+
file_type = "h5"
67+
table_name = "persons"
68+
filepath = "../data/custom_mpo_06197001_model_data.h5"
69+
h5_key = "persons"
9770

98-
the main folder of this repository contains several python scripts that contain the different steps necessary to import, process, and run the demos framework. the following is a description of the different folder and scripts used to run the demos simulation
71+
[[tables]]
72+
file_type = "h5"
73+
table_name = "households"
74+
filepath = "../data/custom_mpo_06197001_model_data.h5"
75+
h5_key = "households"
76+
```
77+
78+
### ii. project structure
9979

100-
1. the `configs\` directory: this folder contains the different `.yaml` configuration files to run each of the demos and urbansim models. the configuration files for each region are located in subdirectories with the name of the region
101-
2. the `data\` directory: contains all the data needed to run the simulation
102-
3. `variables.py`: this script defines all the temporary variables needed to run the models. each variable is created as an orca column.
103-
4. `datasources.py`: this script imports all the necessary data for the specified simulation region and create simulation output folders, if needed.
104-
5. `models.py`: this script defines all the models as orca steps and defines all pre-processing and post-processing steps needed for each of the models.
105-
6. `simulate.py`: this script defines all the simulation parameters and runs the rest of the scripts desribed above.
106-
7. the `outputs\` directory: contains the different results produced by the simulation. simulation results for each region are stored in their respective subdirectories.
80+
>**TODO:** The previous description from Urbansim it outdated. Add description of DEMOS, aligning with the code (paper).

0 commit comments

Comments
 (0)