Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yalinli2 committed Mar 1, 2024
1 parent ba6a98f commit a26048a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion exposan/pou_disinfection/_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def _run(self):
log_removal = self.uv_slope*self.uv_dose + self.uv_intercept
log_N = log_removal + log10(No) #CFU/mL
N = 10**(log_N)
# N = exp(log_red uction + log10(No))
# N = exp(log_reduction + log10(No))

# Log (N0/N) = Kd × UV dose where kd = inactivation rate constant

Expand Down
18 changes: 12 additions & 6 deletions exposan/pou_disinfection/analyses/contextual.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ def run_contextual_analysis():
e_item = ImpactItem.get_item('Electricity')

all_results = {}
for ID in (sys.ID for sys in all_syses):
all_results[f'{ID}_cost'] = {}
all_results[f'{ID}_gwp'] = {}
# Sort by metric type
for metric in ('cost', 'gwp'):
for ID in (sys.ID for sys in all_syses):
all_results[f'{ID}_{metric}'] = {}

# # Sort by country
# for ID in (sys.ID for sys in all_syses):
# all_results[f'{ID}_cost'] = {}
# all_results[f'{ID}_gwp'] = {}

for community, data in contextual_data.iterrows():
PowerUtility.price = data.e_cost
Expand Down Expand Up @@ -77,7 +83,7 @@ def plot_world_map():
# https://www.naturalearthdata.com/downloads/110m-cultural-vectors/
world_folder = os.path.join(data_path, 'ne_110m_admin_0_countries')
world_shape = gpd.read_file(os.path.join(world_folder, 'ne_110m_admin_0_countries.shp'))

# Extract only useful columns
world_trimmed = gpd.GeoDataFrame(geometry=world_shape['geometry'].copy())
for column in ['NAME', 'ISO_A2', 'CONTINENT']:
Expand Down Expand Up @@ -110,5 +116,5 @@ def plot_world_map():
# %%

if __name__ == '__main__':
# run_contextual_analysis()
plot_world_map()
run_contextual_analysis()
# plot_world_map()
Binary file modified exposan/pou_disinfection/data/_raw_water.xlsx
Binary file not shown.

0 comments on commit a26048a

Please sign in to comment.