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

Refactor some features #65

Merged
merged 35 commits into from
May 16, 2022
Merged

Refactor some features #65

merged 35 commits into from
May 16, 2022

Conversation

albireox
Copy link
Member

@albireox albireox commented May 8, 2022

This PR is a relatively major refactor of some features in lvmieb while maintaining most of the actor commands and functionality.

The main changes are:

  • Split IEBController into several classes for motors, WAGO, pressure transducers, and depth probes. In the current code the IebController handles everything but actually multiple instances are generated for each spectrograph, one for each type of device. I think this is not ideal since a lot of the methods are not valid for the current device (for example, if IebController has been instantiated for a pressure transducer all the WAGO methods would fail). In this version the IEBController is a pretty simple collection of individual controllers.
  • Simplified a bit how the actor is instantiated from the configuration file to take advantage of the new IEBController.
  • Done some refctoring of the actor commands but for the most part the command names and options are the same. I have, however, changed the output keywords so that the main keyword name is not the spectrograph. I think it's better for the main keyword to be the measurement returned.
  • Added a keyword schema and some general engineering tweaks.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 8, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1c0ed4a
Status: ✅  Deploy successful!
Preview URL: https://09b45756.osuactor.pages.dev

View logs

@albireox albireox marked this pull request as ready for review May 12, 2022 19:09
@albireox albireox requested a review from mmingyeong May 12, 2022 19:10
@codecov
Copy link

codecov bot commented May 14, 2022

Codecov Report

Merging #65 (1c0ed4a) into main (d691b9e) will increase coverage by 23.2%.
The diff coverage is 87.4%.

@@           Coverage Diff            @@
##            main     #65      +/-   ##
========================================
+ Coverage   66.0%   89.2%   +23.2%     
========================================
  Files         12      17       +5     
  Lines        960     661     -299     
  Branches     187     112      -75     
========================================
- Hits         633     589      -44     
+ Misses       266      45     -221     
+ Partials      61      27      -34     
Impacted Files Coverage Δ
python/lvmieb/__init__.py 100.0% <ø> (ø)
python/lvmieb/actor/commands/__init__.py 100.0% <ø> (+4.0%) ⬆️
python/lvmieb/actor/commands/hartmann.py 79.8% <71.9%> (+1.5%) ⬆️
python/lvmieb/actor/commands/shutter.py 78.9% <72.4%> (-5.4%) ⬇️
python/lvmieb/actor/actor.py 77.0% <80.5%> (-4.4%) ⬇️
python/lvmieb/controller/motor.py 86.9% <86.9%> (ø)
python/lvmieb/controller/pressure.py 86.9% <86.9%> (ø)
python/lvmieb/controller/depth.py 93.2% <93.2%> (ø)
python/lvmieb/actor/__init__.py 100.0% <100.0%> (ø)
python/lvmieb/actor/commands/depth.py 100.0% <100.0%> (+17.9%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d691b9e...1c0ed4a. Read the comment docs.

@changgonKim changgonKim merged commit 4435f69 into main May 16, 2022
@changgonKim changgonKim deleted the albireox/update branch May 16, 2022 02:00
Copy link
Collaborator

@changgonKim changgonKim left a comment

Choose a reason for hiding this comment

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

Sorry for my spaghetti codes, and thanks for upgrading my code with excellent quality. I will learn more from the refracted code.

@changgonKim changgonKim restored the albireox/update branch May 16, 2022 02:09
@albireox albireox deleted the albireox/update branch May 16, 2022 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants