Skip to content

Commit

Permalink
Proportion fix (#115)
Browse files Browse the repository at this point in the history
* fix: Update sorting watchlist to be saved

Reason for change:
Previously the sorted site watchlist was not being saved, and thus
follow-up scheduling was being done based on recency and not measure
site rates.

While not necessarily wrong from a standpoint of reflecting real world
work practices, this behavior was incorrect in the sense that it did
not match intended behavior or descriptions.

Resolution:
The sorted watchlist is now properly saved to be used for later.

Effect(s) of change:
Simulations using proportion will now function correctly.
  • Loading branch information
ThomasGalesloot committed Sep 19, 2023
1 parent 16fe2a9 commit 4794c49
Show file tree
Hide file tree
Showing 79 changed files with 29,966 additions and 23 deletions.
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_OGI.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: OGI
deployment_type: mobile
measurement_scale: component
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_OGI_FU.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: OGI_FU
deployment_type: mobile
measurement_scale: component
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_aircraft.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: aircraft
deployment_type: mobile
measurement_scale: equipment
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_aircraft_ex_sensor.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: aircraft_ex_sensor
deployment_type: mobile
measurement_scale: equipment
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_drone.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: drone
deployment_type: mobile
measurement_scale: equipment
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/M_truck.yaml
@@ -1,5 +1,5 @@
parameter_level: method
version: "3.2"
version: "3.3"
label: truck
deployment_type: mobile
measurement_scale: equipment
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_OGI.yaml
@@ -1,5 +1,5 @@
program_name: P_OGI
parameter_level: program
version: "3.2"
version: "3.3"
method_labels:
- OGI
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_aircraft.yaml
@@ -1,6 +1,6 @@
program_name: P_aircraft
parameter_level: program
version: "3.2"
version: "3.3"
method_labels:
- aircraft
- OGI_FU
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_aircraft_ex_sensor.yaml
@@ -1,6 +1,6 @@
program_name: P_aircraft_ex_sensor
parameter_level: program
version: "3.2"
version: "3.3"
method_labels:
- aircraft_ex_sensor
- OGI_FU
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_drone.yaml
@@ -1,6 +1,6 @@
program_name: P_drone
parameter_level: program
version: "3.2"
version: "3.3"
method_labels:
- drone
- OGI_FU
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_none.yaml
@@ -1,4 +1,4 @@
program_name: P_none
parameter_level: program
version: "3.2"
version: "3.3"
method_labels: []
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_truck.yaml
@@ -1,6 +1,6 @@
program_name: P_truck
parameter_level: program
version: "3.2"
version: "3.3"
method_labels:
- truck
- OGI_FU
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/Simulation_settings.yaml
@@ -1,5 +1,5 @@
parameter_level: simulation_settings
version: "3.2"
version: "3.3"
pregenerate_leaks: True
reference_program: P_OGI
baseline_program: P_none
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/virtual_world.yml
@@ -1,2 +1,2 @@
version: "3.2"
version: "3.3"
parameter_level: "virtual_world"
4 changes: 2 additions & 2 deletions LDAR_Sim/src/default_parameters/m_default.yml
@@ -1,5 +1,5 @@
parameter_level: "method"
version: "3.0"
version: "3.3"
label: "_placeholder_str_"
measurement_scale: "_placeholder_str_" # site/equipment/component
deployment_type: "_placeholder_str_" # mobile/stationary/orbit
Expand Down Expand Up @@ -50,4 +50,4 @@ follow_up:
proportion: 1.0 # 0 to 1.0
redundancy_filter: "recent" # recent/max/average
threshold: 0.0 # g/s
threshold_type: "absolute" # absolute/relative
threshold_type: "absolute" # absolute/relative
2 changes: 1 addition & 1 deletion LDAR_Sim/src/default_parameters/p_default.yml
@@ -1,4 +1,4 @@
version: "3.0"
version: "3.3"
parameter_level: "program"
program_name: "default"
method_labels: []
Expand Down
@@ -1,5 +1,5 @@
parameter_level: "simulation_settings"
version: "3.0"
version: "3.3"
input_directory: "./inputs"
output_directory: "./outputs"
baseline_program: P_none
Expand Down
2 changes: 1 addition & 1 deletion LDAR_Sim/src/default_parameters/virtual_world_default.yml
@@ -1,4 +1,4 @@
version: "3.0"
version: "3.3"
parameter_level: "virtual_world"
weather_file: "weather_alberta.nc"
weather_is_hourly: True # True/False
Expand Down
4 changes: 2 additions & 2 deletions LDAR_Sim/src/initialization/versioning.py
Expand Up @@ -61,6 +61,6 @@ def check_major_version(version_string, major_version):

CURRENT_MAJOR_VERSION = "3"

CURRENT_MINOR_VERSION = "2"
CURRENT_MINOR_VERSION = "3"

CURRENT_FULL_VERSION = "3.2"
CURRENT_FULL_VERSION = "3.3"
1 change: 1 addition & 0 deletions LDAR_Sim/src/methods/company.py
Expand Up @@ -264,6 +264,7 @@ def candidates_to_watchlist(self):
key=lambda x: x[1]['site_measured_rate'],
reverse=True)
}
self.site_watchlist = site_wl

def flag_site(self, site):
""" Flag a single site and check for leak redundancy
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
Simulating program: P_OGI ; simulation 1 of 1
Finished simulating program P_OGI ; simulation 1 of 1

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
Simulating program: P_aircraft ; simulation 1 of 1
Finished simulating program P_aircraft ; simulation 1 of 1

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
Simulating program: P_none ; simulation 1 of 1
Finished simulating program P_none ; simulation 1 of 1

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
{'P_aircraft': {'version': '3.2', 'parameter_level': 'program', 'program_name': 'P_aircraft', 'method_labels': ['aircraft', 'OGI_FU'], 'economics': {'carbon_price_tonnesCO2e': 40.0, 'cost_CCUS': 20.0, 'GWP_CH4': 28.0, 'sale_price_natgas': 3.0, 'repair_costs': {'vals': [200], 'file': None}, 'verification_cost': 0}, 'methods': {'aircraft': {'parameter_level': 'method', 'version': '3.2', 'label': 'aircraft', 'measurement_scale': 'equipment', 'deployment_type': 'mobile', 'sensor': {'type': 'default', 'QE': 0.0, 'MDL': [1], 'mod_loc': None}, 'coverage': {'spatial': 0.9, 'temporal': 0.9}, 'cost': {'per_day': 0, 'per_hour': 0, 'per_site': 200, 'upfront': 0}, 'n_crews': None, 'consider_daylight': False, 'RS': 4, 'time': 1, 'max_workday': 8, 'reporting_delay': 2, 't_bw_sites': {'file': None, 'vals': [5]}, 'scheduling': {'deployment_months': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'deployment_years': [], 'LDAR_crew_init_location': [-114.062, 51.044], 'home_bases_files': 'Airport_AB_Coordinates.csv', 'route_planning': False, 'travel_speeds': [], 'min_time_bt_surveys': None}, 'weather_envs': {'precip': [0.0, 0.5], 'temp': [-40.0, 40.0], 'wind': [0.0, 10.0]}, 'is_follow_up': False, 'follow_up': {'preferred_method': None, 'delay': 0, 'instant_threshold': None, 'instant_threshold_type': 'absolute', 'interaction_priority': 'threshold', 'min_followups': [], 'min_followup_type': 'annual', 'min_followup_days_to_end': 0, 'proportion': 0.5, 'redundancy_filter': 'recent', 'threshold': 0.0, 'threshold_type': 'absolute'}}, 'OGI_FU': {'parameter_level': 'method', 'version': '3.2', 'label': 'OGI_FU', 'measurement_scale': 'component', 'deployment_type': 'mobile', 'sensor': {'type': 'default', 'QE': 0.0, 'MDL': [0.0362], 'mod_loc': None}, 'coverage': {'spatial': 0.9, 'temporal': 0.9}, 'cost': {'per_day': 0, 'per_hour': 0, 'per_site': 700, 'upfront': 0}, 'n_crews': None, 'consider_daylight': False, 'RS': None, 'time': 120, 'max_workday': 8, 'reporting_delay': 2, 't_bw_sites': {'file': None, 'vals': [45]}, 'scheduling': {'deployment_months': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'deployment_years': [], 'LDAR_crew_init_location': [-114.062, 51.044], 'home_bases_files': 'Airport_AB_Coordinates.csv', 'route_planning': False, 'travel_speeds': [], 'min_time_bt_surveys': None}, 'weather_envs': {'precip': [0.0, 0.5], 'temp': [-40.0, 40.0], 'wind': [0.0, 10.0]}, 'is_follow_up': True, 'follow_up': {'preferred_method': None, 'delay': 0, 'instant_threshold': None, 'instant_threshold_type': 'absolute', 'interaction_priority': 'threshold', 'min_followups': [], 'min_followup_type': 'annual', 'min_followup_days_to_end': 0, 'proportion': 1.0, 'redundancy_filter': 'recent', 'threshold': 0.0, 'threshold_type': 'absolute'}}}}, 'P_none': {'version': '3.2', 'parameter_level': 'program', 'program_name': 'P_none', 'method_labels': [], 'economics': {'carbon_price_tonnesCO2e': 40.0, 'cost_CCUS': 20.0, 'GWP_CH4': 28.0, 'sale_price_natgas': 3.0, 'repair_costs': {'vals': [200], 'file': None}, 'verification_cost': 0}, 'methods': {}}, 'P_OGI': {'version': '3.2', 'parameter_level': 'program', 'program_name': 'P_OGI', 'method_labels': ['OGI'], 'economics': {'carbon_price_tonnesCO2e': 40.0, 'cost_CCUS': 20.0, 'GWP_CH4': 28.0, 'sale_price_natgas': 3.0, 'repair_costs': {'vals': [200], 'file': None}, 'verification_cost': 0}, 'methods': {'OGI': {'parameter_level': 'method', 'version': '3.2', 'label': 'OGI', 'measurement_scale': 'component', 'deployment_type': 'mobile', 'sensor': {'type': 'default', 'QE': 0.0, 'MDL': [0.0362], 'mod_loc': None}, 'coverage': {'spatial': 0.9, 'temporal': 0.9}, 'cost': {'per_day': 0, 'per_hour': 0, 'per_site': 600, 'upfront': 0}, 'n_crews': None, 'consider_daylight': False, 'RS': 2, 'time': 120, 'max_workday': 8, 'reporting_delay': 2, 't_bw_sites': {'file': None, 'vals': [30]}, 'scheduling': {'deployment_months': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'deployment_years': [], 'LDAR_crew_init_location': [-114.062, 51.044], 'home_bases_files': 'Airport_AB_Coordinates.csv', 'route_planning': False, 'travel_speeds': [], 'min_time_bt_surveys': None}, 'weather_envs': {'precip': [0.0, 0.5], 'temp': [-40.0, 40.0], 'wind': [0.0, 10.0]}, 'is_follow_up': False, 'follow_up': {'preferred_method': None, 'delay': 0, 'instant_threshold': None, 'instant_threshold_type': 'absolute', 'interaction_priority': 'threshold', 'min_followups': [], 'min_followup_type': 'annual', 'min_followup_days_to_end': 0, 'proportion': 1.0, 'redundancy_filter': 'recent', 'threshold': 0.0, 'threshold_type': 'absolute'}}}}}
2023-09-14 14:05:38.079679
@@ -0,0 +1,4 @@
program_name,verification_cost,repair_cost,nat_repair_cost,aircraft_cost,OGI_FU_cost,OGI_cost,value_gas_sold,adjusted_program_cost
P_OGI,0.0,0.13368,0.35768,,,1.2,-0.2552237263988851,1.4361362736011152
P_aircraft,0.0,0.0026399999999999996,0.47248,0.8,0.006440000000000001,,-0.03202077520035881,1.249539224799641
P_none,0.0,0.0,0.47496000000000005,,,,-0.0,0.47496000000000005
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,4 @@
,program_name,total_program_emissions_kg,sale_price_natgas,GWP_CH4,carbon_price_tonnesCO2e,cost_CCUS,total_program_cost,total_emissions_mcf,simulation_avg_emissions_tonnesCO2e,difference_base_mcf,value_gas_sold,dif_base_tonnesCO2e,cost_mitigation_ratio
0,P_OGI,4820478.598389367,3.0,28.0,40.0,20.0,4228400.0,251082.23533708105,134973.40075490225,-212686.43866573754,638059.3159972127,114333.10637299373,36.98316379339429
1,P_aircraft,8391503.339564212,3.0,28.0,40.0,20.0,3203900.0,437084.69466918625,234962.09350779792,-26683.979333632335,80051.938000897,14344.41362009804,223.35524371041544
2,P_none,8903803.825996285,3.0,28.0,40.0,20.0,1187400.0,463768.6740028186,249306.50712789598,0.0,0.0,0.0,0.0

0 comments on commit 4794c49

Please sign in to comment.