Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
02-EnergyModel/*.tar.gz
02-EnergyModel/*.tar
02-EnergyModel/*.Rhistory
*.egg-info
*__pycache__
3 changes: 2 additions & 1 deletion 01-ActivityModel/activity-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ machine:

```bash
$ git clone https://github.com/anetobradley/energy_flex.git
$ cd energy_flex/01-ActivityModel/activity-model/
$ cd 01-ActivityModel/activity-model/
```

This package requires a specific
Expand Down Expand Up @@ -59,6 +59,7 @@ $ nano config/user.yaml
# EPC credentials
epc_user: "user@email"
epc_key: "user_key"
# the epc key can be found at the bottom of the https://epc.opendatacommunities.org/ website next to the email you have used to log in.
```

#### Local Authority codes
Expand Down
2 changes: 1 addition & 1 deletion 01-ActivityModel/activity-model/activity_model/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enriching_population import EnrichingPopulation

if __name__ == "__main__":
print("hi")
print("Running the Activity model process, this can take a while, depending on how many areas you have added.")
spenser = Spenser()
epc = Epc()
psm = EnrichingPopulation()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1.0'
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import yaml

from data_preparation import Epc, Spenser
from enriching_population import EnrichingPopulation

if __name__ == "__main__":
print("hi")
spenser = Spenser()
epc = Epc()
psm = EnrichingPopulation()

list_df = []
list_df_names = []
lad_codes_yaml = open("config/lad_codes.yaml")
parsed_lad_codes = yaml.load(lad_codes_yaml, Loader=yaml.FullLoader)
lad_codes = parsed_lad_codes.get("lad_codes")

for lad_code in lad_codes:
spenser_df = spenser.step(lad_code)
epc_df = epc.step(lad_code)
rich_df = psm.step(
spenser_df, epc_df, lad_code, psm_fig=True, validation_fig=True
)
list_df_names.append("_".join([lad_code, "hh_msm_epc.csv"]))
list_df.append(rich_df)

psm.save_enriched_pop(list_df_names, list_df)

Loading