Skip to content

Commit

Permalink
DAQ Tweaks (#25)
Browse files Browse the repository at this point in the history
* Try not pre-allocating the arrays

* Add holidays as dep for all groups

* update hash

* move pandas

* Updated poetry lock

* Remove commented out code
Note, this might need to be reversed later, depending on which method used less memory

* Added --no-root option for poetry install

* Fix poetry python versions
  • Loading branch information
mepland authored Nov 14, 2023
1 parent 5e5b325 commit 53af4d0
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 145 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
setupDAQ:
poetry install --with daq,web,dev
poetry install --with daq,web,dev --no-root
poetry run pre-commit install

setupANA:
poetry install --with ana,dev
poetry install --with ana,dev --no-root
poetry run pre-commit install

poetry:
Expand Down
5 changes: 1 addition & 4 deletions daq/daq.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ def daq( # noqa: C901 # pylint: disable=too-many-statements, too-many-locals
# DAQ variables
N_POLLING: Final = int(np.ceil(AVERAGING_PERIOD_SECONDS / POLLING_PERIOD_SECONDS))
# pylint: enable=invalid-name
# test if defining here first saves memory?
polling_pressure_samples = np.empty(N_POLLING)
polling_pressure_samples.fill(np.nan)
polling_flow_samples = np.zeros(N_POLLING) # noqa: F841 # pylint: disable=unused-variable

################################################################################
# Lock script, avoid launching duplicates
Expand Down Expand Up @@ -620,6 +616,7 @@ def daq_loop(t_utc_str: str, t_local_str: str) -> None: # pylint: disable=too-m
i_polling = 0
# reset variables
had_flow = 0 # avoid sticking high if we lose pressure while flowing
polling_pressure_samples = np.empty(N_POLLING)
polling_pressure_samples.fill(np.nan)
polling_flow_samples = np.zeros(N_POLLING)
while running_daq_loop and t_stop - t_start < datetime.timedelta(
Expand Down
Loading

0 comments on commit 53af4d0

Please sign in to comment.