Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water Vapor Radiometer Agent #429

Merged
merged 62 commits into from
Sep 1, 2023
Merged

Water Vapor Radiometer Agent #429

merged 62 commits into from
Sep 1, 2023

Conversation

sanahabhimani
Copy link
Contributor

OCS agent to monitor pwv values for water vapor radiometer on-site

Description

The UCSC radiometer measures precipitable water vapor (pwv) of the atmosphere,
and outputs the values to a textfile per day on a computer at the site where OCS
is not setup. As a result, a Flask app is built to server textfiles from the
radiometer server, where this Agent uses HTTP queries to publish pwv data to OCS.

Motivation and Context

Allows us to monitor pwv values in real-time. Fixes #147

How Has This Been Tested?

Has been tested on local setup with Flask server running based off of simulated pwv textfiles

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@sanahabhimani sanahabhimani self-assigned this Mar 27, 2023
@BrianJKoopman BrianJKoopman added the new agent New OCS agent needs to be created label Apr 19, 2023
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Just a couple of minor suggestions and a request related to the fix for speeding up the tests.

socs/agents/ucsc_radiometer/agent.py Outdated Show resolved Hide resolved
socs/agents/ucsc_radiometer/agent.py Outdated Show resolved Hide resolved
docs/agents/ucsc_radiometer.rst Show resolved Hide resolved
@BrianJKoopman
Copy link
Member

One other thing, can you merge the latest main again? I'm not sure why pre-commit only caught those changes in the wiregrid actuator now. But I merged those into main already (in #513) to keep it separate from this PR. Catching up to main should remove those changes from here.

Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes still needed here.

socs/agents/ucsc_radiometer/agent.py Outdated Show resolved Hide resolved
docs/agents/ucsc_radiometer.rst Show resolved Hide resolved
socs/agents/ucsc_radiometer/agent.py Outdated Show resolved Hide resolved
tests/default.yaml Outdated Show resolved Hide resolved
I expect the installation process to change, just rely on the linked repo for
instructions to reduce maintenance burden.
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for all the updates!

@BrianJKoopman BrianJKoopman merged commit 5b424a4 into main Sep 1, 2023
4 checks passed
@BrianJKoopman BrianJKoopman deleted the pwv_agent branch September 1, 2023 17:57
hnakata-JP pushed a commit that referenced this pull request Apr 12, 2024
* commit PWV agent

* commit pwv_agent.py

* commit changes to pwv agent

* found and fixed errors to functions outside of class

* keeping variable names consistent

* Setup demo Flask server for fetching latest pwv value

* Automatically fetch latest pwv file in api

* Add docstring, mark private methods as such, and data dir outside of helper function

* Setup to run with gunicorn and write README

* rename pwv agent script to match latest socs version

* move pwv_agent dir to correct up-to-date socs path

* update pwv agent for socs pluginification and flask server changes

* clean off unnecessary functions and add docstrings

* implement flake8 comments

* change directory/class name of agent to vendor/hardware name

* change acq name process

* clean up acq, _stop_acq, and __init__, and add test_mode

* add radiometer agent docs

* update radiometer agent description

* fix typo to actually compare timestamps in acq()

* add pacemaker

* commit flake8 rules

* commit tests for radioimeter agent

* fix pwv agent in plugin.py to updated dir and agent class name

* update ocs_plugin_so.py to match PWV agent's updated name/class

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix flake8 warning

* remove year arg for agent

* change flask server working to radiometer web server

* add session.data for pwv vals

* remove argparse args

* add session.data output to docstring

* remove year in example

* remove supporting APIs section in docs

* add blank line for docs consistency

* change phrasing to be specific about PWV agent mechanics

* change the port back to 5000

* skip pacemaker step if in test mode

* remove api from socs repo

* change port on http mock test for consistency

* update test to work pytest-docker plugin instead of pytest-docker-compose

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change port for radiometer in config file

* fix data key to avoid nested structure

* move pacemaker outside of loop

* add test_mode to startup params

* bye bye 'hi'

* remove acq.stop() in test now that test_params exist

* fix test_mode arg

* fix test mode arg string and replace type with action

* add dependencies to the docs

* fix test_params dict for agent startup

* clean up test_mode conditional and clarify test-mode argument

* add test-mode to tests config file for agents

* Flatten args list for radiometer agent

* Remove install instructions from readme

I expect the installation process to change, just rely on the linked repo for
instructions to reduce maintenance burden.

---------

Co-authored-by: Brian Koopman <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new agent New OCS agent needs to be created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Water Vapor Radiometer Agent
2 participants