Skip to content

Commit

Permalink
correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Oct 29, 2024
1 parent fa3cab3 commit 922f2d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- faster syncing configs.
- faster copying files across cluster via `pio cp`.
- faster clean up of jobs using PWMs.
- New installs only: updated base RPiOS to 2024-10-22.
- new installs only: updated base RPiOS to 2024-10-22.
- new database table in `/tmp/local_intermittent_pioreactor_metadata.sqlite` called `pio_job_published_settings` that stores the published settings for each job. This powers the next API endpoints:
- New API endpoints for getting the current settings of a _running_ job:
- Per pioreactor:
Expand All @@ -23,8 +23,8 @@
- GET: `/api/jobs/settings/job_name/<job_name>/setting/<setting>`
- GET: `/api/jobs/settings/job_name/<job_name>/experiments/<experiment>`
- GET: `/api/jobs/settings/job_name/<job_name>/experiments/<experiment>/setting/<setting>`
- GET: `/api/jobs/settings/workers/<unit>/job_name/<job_name>/experiments/<experiment>`
- GET: `/api/jobs/settings/workers/<unit>/job_name/<job_name>/experiments/<experiment>/setting/<setting>`
- GET: `/api/jobs/settings/workers/<pioreactor_unit>/job_name/<job_name>`
- GET: `/api/jobs/settings/workers/<pioreactor_unit>/job_name/<job_name>/setting/<setting>`
Ex: query the temperature of a Pioreactor: `curl http://pio01.local/unit_api/jobs/settings/job_name/temperature_automation/setting/temperature`


Expand All @@ -40,6 +40,8 @@
- correct ethernet mac address on RPi5s
- We weren't passing all the OS environment variables when jobs were started from the UI. This is fixed now.
- Fixed circulate media / alt. media in the UI.
- Fixed manual dosing updates in the UI.



### 24.10.1
Expand Down
11 changes: 5 additions & 6 deletions pioreactor/actions/leader/export_experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,14 @@ def export_experiment_data(
_partition_by_unit = True

if not _partition_by_unit:
if experiment is None and "experiment" in get_column_names(cursor, table):
query = f"SELECT {timestamp_to_localtimestamp_clause} * from {table} ORDER BY {order_by}"
cursor.execute(query)
filename = f"{table}-{time}.csv"

else:
if experiment is not None and "experiment" in get_column_names(cursor, table):
query = f"SELECT {timestamp_to_localtimestamp_clause} * from {table} WHERE experiment=:experiment ORDER BY {order_by}"
cursor.execute(query, {"experiment": experiment})
filename = f"{experiment}-{table}-{time}.csv"
else:
query = f"SELECT {timestamp_to_localtimestamp_clause} * from {table} ORDER BY {order_by}"
cursor.execute(query)
filename = f"{table}-{time}.csv"

filename = filename.replace(" ", "_")
path_to_file = os.path.join(os.path.dirname(output), filename)
Expand Down

0 comments on commit 922f2d5

Please sign in to comment.