Skip to content

Commit

Permalink
<UPD>: Add more runtime messages (#255)
Browse files Browse the repository at this point in the history
Reason for change:
Nice to have additional runtime messages

Effect(s) of change:
- Add more runtime messages
- Fix existing runtime message that was printing when it shouldn't be
  • Loading branch information
SEAJang authored Jul 11, 2024
1 parent 47f077c commit 60ff3bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LDAR_Sim/src/constants/error_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Runtime_Warning_Messages:
"Warning: LDAR-Sim has detected a potential for crew shortage for the method: {method}"
)
FOLLOW_UP_METHOD_CREW_ESTIMATION = (
"Warning: LDAR-Sim as defaulted to a single crew for the following follow-up method: {method}"
"Warning: LDAR-Sim as defaulted to a single crew for the following follow-up method: {method}. "
"This may lead to crew shortages, please provide a crew count for this method if this is not intended."
)

Expand Down
1 change: 1 addition & 0 deletions LDAR_Sim/src/constants/output_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RuntimeMessages:

SIM_SET = "......Simulating set {simulation_number}"
SIM_PROG = ".........Simulating program: {prog_name}"
SUMMARIZE_PROG = "............Summarizing program: {prog_name}"
FIN_PROG = "......... Finished simulating program: {prog_name}"
FIN_SIM_SET = "...Finished simulating set {simulation_number}"
BATCH_CLEAN = "...Cleaning up batch {batch_count} data"
Expand Down
2 changes: 2 additions & 0 deletions LDAR_Sim/src/ldar_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
EMIS_DATA_FINAL_COL_ORDER,
TIMESERIES_COL_ACCESSORS as tca,
)
from constants.output_messages import RuntimeMessages as rm
from constants.param_default_const import Virtual_World_Params as vp


Expand Down Expand Up @@ -114,6 +115,7 @@ def run_simulation(self):
self._program.update_date()
self._tc.next_day()

print(rm.SUMMARIZE_PROG.format(prog_name=self._program.name))
overall_emission_data: pd.DataFrame = pd.DataFrame(
columns=EMIS_DATA_FINAL_COL_ORDER, index=range(total_emissions_count)
)
Expand Down
4 changes: 3 additions & 1 deletion LDAR_Sim/src/programs/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ def _estimate_method_crews_required(
)

else:
print(rwm.FOLLOW_UP_METHOD_CREW_ESTIMATION.format(method=self._name))
estimate_req_n_crews = 1
if crews < 1:
print(rwm.FOLLOW_UP_METHOD_CREW_ESTIMATION.format(method=self._name))

if crews > 0:
if estimate_req_n_crews > crews:
print(rwm.POTENTIAL_CREW_SHORTAGE_MESSAGE.format(method=self._name))
Expand Down

0 comments on commit 60ff3bb

Please sign in to comment.