You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A key variable is 'sites', which is a list containing sites (dict format), which themselves contains a list of leaks (dict format). It is proposed that this variable be broken into a flat tabular data format - one variable for the sites and one for the leaks.
Need for feature/Enhancement
The code for LDAR-Sim contains extensive, often nested, for loops which is unusual in Python. This is due in part due the data not being in an array or table format.
Problem to solve
I suspect this change will significantly increase performance and readability since it will be possible to use vectorized functions and not always have to loop through the complex data structure.
Implementation Ideas
While the change is definitely non-trivial, the sites and leaks already contains a table-like format, linked by facility ID. I think a typical pandas dataframe format would work, or even long-term an embedded sqlite database.
Thanks for the great feedback. Updating the LDAR-Sim data structure is something we've wanted to do for some time now. We plan on addressing this in the near future, but it won't happen right away due to the non-trivial nature of developing and testing such a change.
Requested Feature/Enhancement
A key variable is 'sites', which is a list containing sites (dict format), which themselves contains a list of leaks (dict format). It is proposed that this variable be broken into a flat tabular data format - one variable for the sites and one for the leaks.
Need for feature/Enhancement
The code for LDAR-Sim contains extensive, often nested, for loops which is unusual in Python. This is due in part due the data not being in an array or table format.
Problem to solve
I suspect this change will significantly increase performance and readability since it will be possible to use vectorized functions and not always have to loop through the complex data structure.
Implementation Ideas
While the change is definitely non-trivial, the sites and leaks already contains a table-like format, linked by facility ID. I think a typical pandas dataframe format would work, or even long-term an embedded sqlite database.
Additional context
A motivating example is update_state, which seems to rebuild self.active_leaks from scratch at every time step with a nested loop:
https://github.com/LDAR-Sim/LDAR_Sim/blob/336b2ba5264459e072465b05faf6f7813cd1470f/LDAR_Sim/src/ldar_sim.py#L290C12-L290C12
The text was updated successfully, but these errors were encountered: