|
1 | 1 | ## Setup |
2 | 2 |
|
3 | | -Clone the repository and ensure an installation of [uv](https://docs.astral.sh/uv/getting-started/installation/) exists. Create a local virtual environment by running `uv venv` then `uv sync` in the command line. Ensure that a `secrets.yml` file exists |
4 | | - |
5 | | -### Configuration of Private Data in secrets.yml |
6 | | -In order to avoid exposing certain data to the public this repository uses a secrets file to store sensitive configurations in addition to a standard configuration file. This file is stored in the root directory of the repository as `secrets.yml` and is included in the `.gitignore` intentionally to avoid it ever being committed to the repository. |
7 | | - |
8 | | -The `secrets.yml` should mirror the following structure. |
9 | | - |
10 | | -```yaml |
11 | | -sql: |
12 | | - estimates: |
13 | | - server: <SqlInstanceName> # SQL instance containing estimates database |
14 | | - database: <SqlDatabaseName> # database within SQL instance containing SQL build objects |
15 | | - gis: |
16 | | - server: <SqlInstanceName> # SQL instance containing GIS database |
17 | | - database: <SqlDatabaseName> # database within instance containing GIS datasets (GQ/LUDU) |
18 | | - staging: <FolderPath> # unconditional network folder path visible to SQL instance for BULK INSERT |
| 3 | +Clone the repository and ensure an installation of [uv](https://docs.astral.sh/uv/getting-started/installation/) exists. Create a local virtual environment by running `uv venv` then `uv sync` in the command line. Ensure that a `secrets.toml` file exists |
| 4 | + |
| 5 | +### Configuration of Private Data in secrets.toml |
| 6 | +In order to avoid exposing certain data to the public this repository uses a secrets file to store sensitive configurations in addition to a standard configuration file. This file is stored in the root directory of the repository as `secrets.toml` and is included in the `.gitignore` intentionally to avoid it ever being committed to the repository. |
| 7 | + |
| 8 | +The `secrets.toml` should mirror the following structure. |
| 9 | + |
| 10 | +```toml |
| 11 | +[sql.estimates] |
| 12 | +server = "<SqlInstanceName>" # SQL instance containing estimates database |
| 13 | +database = "<SqlDatabaseName>" # database within SQL instance containing SQL build objects |
| 14 | + |
| 15 | +[sql.gis] |
| 16 | +server = "<SqlInstanceName>" # SQL instance containing GIS database |
| 17 | +database = "<SqlDatabaseName>" # database within instance containing GIS datasets (GQ/LUDU) |
| 18 | + |
| 19 | +[sql] |
| 20 | +staging = "<FolderPath>" # unconditional network folder path visible to SQL instance for BULK INSERT |
19 | 21 | ``` |
20 | 22 |
|
21 | 23 | ## Running |
22 | 24 |
|
23 | | -Set the configuration file `config.yml` parameters specific to the run in the project root directory. Finally, simply execute `uv run main.py` in the main project directory |
| 25 | +Set the configuration file `config.toml` parameters specific to the run in the project root directory. Finally, simply execute `uv run main.py` in the main project directory |
24 | 26 |
|
25 | 27 | ### Configuration File Settings |
26 | 28 |
|
27 | 29 | The default version of the runtime configuration file is copied here, with comments explaining each and every key/value pair |
28 | 30 |
|
29 | | -```yaml |
| 31 | +```toml |
30 | 32 | # Configuration for what parts of the Estimates Program to run. Since this file may be |
31 | 33 | # modified from the default settings, you can always restore to default using the copy |
32 | 34 | # stored in README.md. For brevity, detailed comments have been removed from this file |
33 | 35 |
|
34 | 36 | # The 'run' section contains configuration for running every module of the Estimates |
35 | 37 | # Program for a specified set of years |
36 | | -run: |
37 | | - |
38 | | - # Whether to use the 'run' section. Mutually exclusive with 'debug' mode |
39 | | - enabled: False |
40 | | - |
41 | | - # The MGRA series to use for this run. Currently only 'mgra15' is valid |
42 | | - mgra: mgra15 |
43 | | - |
44 | | - # The first year inclusive to start running from |
45 | | - start_year: 2020 |
46 | | - |
47 | | - # The last year inclusive to end running with |
48 | | - end_year: 2023 |
49 | | - |
50 | | - # The code version |
51 | | - version: 0.0.0-dev |
52 | | - |
53 | | - # Additional notes on this run |
54 | | - comments: Example comment |
| 38 | +[run] |
| 39 | + |
| 40 | +# Whether to use the 'run' section. Mutually exclusive with 'debug' mode |
| 41 | +enabled = false |
| 42 | + |
| 43 | +# The MGRA series to use for this run. Currently only 'mgra15' is valid |
| 44 | +mgra = "mgra15" |
| 45 | + |
| 46 | +# The first year inclusive to start running from |
| 47 | +start_year = 2020 |
| 48 | + |
| 49 | +# The last year inclusive to end running with |
| 50 | +end_year = 2023 |
| 51 | + |
| 52 | +# The code version |
| 53 | +version = "0.0.0-dev" |
| 54 | + |
| 55 | +# Additional notes on this run |
| 56 | +comments = "Example comment" |
55 | 57 |
|
56 | 58 | # The 'debug' section contains configuration for running a subset of modules of the |
57 | 59 | # Estimates Program for a given set of years. All parameters must be provided except for |
58 | | -# 'run_id', 'version', and 'comments'. If 'run_id' is 'null', then a new 'run_id' will |
| 60 | +# 'run_id', 'version', and 'comments'. If 'run_id' is -1, then a new 'run_id' will |
59 | 61 | # be automatically created, similar to 'run' mode |
60 | | -debug: |
61 | | - |
62 | | - # Whether to use the 'debug' section. Mutually exclusive with 'run' mode |
63 | | - enabled: False |
64 | | - |
65 | | - # (Optional) If provided, then most parameters in the 'debug' section will be pulled |
66 | | - # from '[run].[metadata]'. If not provided, then a new 'run_id' will be automatically |
67 | | - # created |
68 | | - run_id: null |
69 | | - |
70 | | - # The first year inclusive and last year inclusive to run. In the case that... |
71 | | - # * The value of 'run_id' is 'null', the values will be loaded into [metadata].[run] |
72 | | - # and will be used as is |
73 | | - # * The value of 'run_id' is not 'null', the values will be checked against the values |
74 | | - # already in '[run].[metadata]' |
75 | | - start_year: 2020 |
76 | | - end_year: 2023 |
77 | | - |
78 | | - # (Optional) The code version. If provided, then 'run_id' must be 'null' |
79 | | - version: 0.0.0-dev |
80 | | - |
81 | | - # (Optional) Additional notes on this run. If provided, then 'run_id' must be 'null' |
82 | | - comments: null |
83 | | - |
84 | | - # Whether to run the 'startup' module |
85 | | - startup: False |
86 | | - |
87 | | - # Whether to run the 'housing_and_households' module. If enabled, then any above |
88 | | - # modules must all be enabled due to module dependencies |
89 | | - housing_and_households: False |
90 | | - |
91 | | - # Whether to run the 'population' module. If enabled, then any above modules must all |
92 | | - # be enabled due to module dependencies |
93 | | - population: False |
94 | | - |
95 | | - # Whether to run the 'population_by_ase' module. If enabled, then any above modules |
96 | | - # must all be enabled due to module dependencies |
97 | | - population_by_ase: False |
98 | | - |
99 | | - # Whether to run the 'household_characteristics' module. If enabled, then any above |
100 | | - # modules must all be enabled due to module dependencies |
101 | | - household_characteristics: False |
102 | | - |
103 | | - # Whether to run the 'staging' module. If enabled, then any above modules must all be |
104 | | - # enabled due to module dependencies |
105 | | - staging: False |
| 62 | +[debug] |
| 63 | + |
| 64 | +# Whether to use the 'debug' section. Mutually exclusive with 'run' mode |
| 65 | +enabled = false |
| 66 | + |
| 67 | +# (Optional) If provided, then most parameters in the 'debug' section will be pulled |
| 68 | +# from '[run].[metadata]'. If not provided, then a new 'run_id' will be automatically |
| 69 | +# created. Use -1 to indicate no run_id (TOML doesn't support null) |
| 70 | +run_id = -1 |
| 71 | + |
| 72 | +# The first year inclusive and last year inclusive to run. In the case that... |
| 73 | +# * The value of 'run_id' is -1, the values will be loaded into [metadata].[run] |
| 74 | +# and will be used as is |
| 75 | +# * The value of 'run_id' is not -1, the values will be checked against the values |
| 76 | +# already in '[run].[metadata]' |
| 77 | +start_year = 2020 |
| 78 | +end_year = 2023 |
| 79 | + |
| 80 | +# (Optional) The code version. If provided, then 'run_id' must be -1 |
| 81 | +version = "0.0.0-dev" |
| 82 | + |
| 83 | +# (Optional) Additional notes on this run. If provided, then 'run_id' must be -1 |
| 84 | +comments = "" |
| 85 | + |
| 86 | +# Whether to run the 'startup' module |
| 87 | +startup = false |
| 88 | + |
| 89 | +# Whether to run the 'housing_and_households' module. If enabled, then any above |
| 90 | +# modules must all be enabled due to module dependencies |
| 91 | +housing_and_households = false |
| 92 | + |
| 93 | +# Whether to run the 'population' module. If enabled, then any above modules must all |
| 94 | +# be enabled due to module dependencies |
| 95 | +population = false |
| 96 | + |
| 97 | +# Whether to run the 'population_by_ase' module. If enabled, then any above modules |
| 98 | +# must all be enabled due to module dependencies |
| 99 | +population_by_ase = false |
| 100 | + |
| 101 | +# Whether to run the 'household_characteristics' module. If enabled, then any above |
| 102 | +# modules must all be enabled due to module dependencies |
| 103 | +household_characteristics = false |
| 104 | + |
| 105 | +# Whether to run the 'staging' module. If enabled, then any above modules must all be |
| 106 | +# enabled due to module dependencies |
| 107 | +staging = false |
106 | 108 | ``` |
107 | 109 |
|
108 | 110 | ### Production Database Schema |
|
0 commit comments