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

Add minimal support for domes into POCS. #248

Merged

Conversation

jamessynge
Copy link
Contributor

Basically just support for closing the dome when done. Still need to figure out how to integrate the dome into the approach state transition. Advice sought.

Tests TBS.

Partially address #199.

@codecov
Copy link

codecov bot commented Dec 24, 2017

Codecov Report

Merging #248 into develop will decrease coverage by 0.38%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #248      +/-   ##
===========================================
- Coverage     79.8%   79.41%   -0.39%     
===========================================
  Files           42       42              
  Lines         3204     3231      +27     
  Branches       415      425      +10     
===========================================
+ Hits          2557     2566       +9     
- Misses         503      515      +12     
- Partials       144      150       +6
Impacted Files Coverage Δ
pocs/core.py 79.83% <0%> (-0.67%) ⬇️
pocs/state/states/default/parking.py 63.63% <20%> (-36.37%) ⬇️
pocs/observatory.py 83.38% <40%> (-2.91%) ⬇️

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 160f3f2...2d5fc43. Read the comment docs.

Copy link
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

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

Approving, but some of those TODO comments should be stripped before actual merge.

pocs/core.py Outdated
@@ -41,6 +41,7 @@ class POCS(PanStateMachine, PanBase):
Attributes:
name (str): Name of PANOPTES unit
next_state (str): The next state for the state machine
TODO(jamessynge): Why document this here? It is an attribute of the base class.
Copy link
Member

Choose a reason for hiding this comment

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

At one point I was going to document all the attributes of PanBase and PanStateMachine here so this is the only place you would have to look. That never happened and isn't a good idea, so this is a remnant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed next_state from docstring.

pocs/core.py Outdated
if not self.observatory.close_dome():
self.logger.critical('Unable to close dome!')

# TODO(jamessynge): Determine why parking is conditional. Is self.park() idempotent?
Copy link
Member

Choose a reason for hiding this comment

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

If you try to park from a state that doesn't support the transition it will complain. The transitions library has since added support for nested states as well as other features that could clean this up, but we should discuss in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I've been wondering about having separate state machines for the different equipment, since it doesn't make sense to continue expanding the base state machine.

@@ -223,6 +224,9 @@ def power_down(self):
"Shutting down {}, please be patient and allow for exit.".format(
self.name))

if not self.observatory.close_dome():
self.logger.critical('Unable to close dome!')
Copy link
Member

Choose a reason for hiding this comment

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

This is perhaps one of those places where we need to somehow add email support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Perhaps we should extend the idea of the "say" method to include a "yell" method, designed to ask for help.

pocs/core.py Outdated
@@ -488,6 +498,8 @@ def _check_messages(self, queue_type, q):
def _interrupt_and_park(self):
self.logger.info('Park interrupt received')
self._interrupted = True
# TODO(jamessynge): Should we close the dome here? Or extend the state machine
# with dome related states and actions?
Copy link
Member

Choose a reason for hiding this comment

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

This will call park from any state that it is currently in and move to the parking state. I think it makes most sense to close the dome in the parking state itself and leave this as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll move it, but I'm concerned that POCS.power_down() assumes that the only device that needs to be dealt with for parking is the mount, and so makes decisions about whether to change state based on whether the mount is connected. @wtgee What do you suggest I do about that?

pocs/core.py Outdated
@@ -461,6 +469,8 @@ def _check_environment(self):
os.makedirs("{}/logs".format(pandir))

def _check_messages(self, queue_type, q):
# TODO(jamessynge): Where do these messages come from? PAWS?
# TODO(jamessynge): Determine what to do about the dome.
Copy link
Member

Choose a reason for hiding this comment

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

Regarding comment below, I don't think this needs to be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do the messages come from PAWS?

@jamessynge jamessynge merged commit f53c96e into panoptes:develop Dec 25, 2017
@wtgee wtgee mentioned this pull request Dec 29, 2017
@jamessynge jamessynge deleted the issue-199-Observatory-dome-operations branch January 1, 2018 02:33
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