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

Weather fixes #513

Merged
merged 4 commits into from
Jul 28, 2021
Merged

Weather fixes #513

merged 4 commits into from
Jul 28, 2021

Conversation

danjampro
Copy link
Contributor

@danjampro danjampro commented Jul 28, 2021

Closes #495
Might close #506, need to check

@danjampro danjampro requested a review from Physarah July 28, 2021 05:49
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #513 (f960668) into develop (8dadf27) will decrease coverage by 0.04%.
The diff coverage is 33.33%.

❗ Current head f960668 differs from pull request most recent head 029be8a. Consider uploading reports for the commit 029be8a to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #513      +/-   ##
===========================================
- Coverage    55.81%   55.76%   -0.05%     
===========================================
  Files           60       60              
  Lines         3967     3972       +5     
  Branches       411      412       +1     
===========================================
+ Hits          2214     2215       +1     
- Misses        1653     1657       +4     
  Partials       100      100              
Impacted Files Coverage Δ
src/huntsman/pocs/utils/safety.py 40.47% <20.00%> (-2.77%) ⬇️
src/huntsman/pocs/observatory.py 58.44% <100.00%> (ø)

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 8dadf27...029be8a. Read the comment docs.

Copy link
Contributor

@Physarah Physarah left a comment

Choose a reason for hiding this comment

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

I think I've asked something like the comment below before but you said it can't get into the take darks state without closing the dome so maybe there is not need for it.

@@ -501,8 +501,8 @@ def take_dark_observation(self, bias=False, **kwargs):
ObsClass = BiasObservation if bias else DarkObservation
observation = ObsClass(position=position)

# Dark observations don't care if it's dark or not
safety_kwargs = {"ignore": ["is_dark"]}
# Dark observations don't care if it's dark or not, or if bad weather
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Dark observations don't care if it's dark or not, or if bad weather
# Dark observations don't care if it's dark or not, or if bad weather
if not self.dome.is_closed:
self.dome.close()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm good point. Or to be flexible, we could just add the is_good_weather to the list of ones to ignore if the dome is already closed. This would allow someone (for whatever reason) to take darks with the dome open.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking this is good enough for now:

        # Dark observations don't care if it's dark or not
        safety_kwargs = {"ignore": ["is_dark"]}

        # Can ignore weather safety if dome is closed
        with suppress(AttributeError):
            if self.dome.is_closed:
                safety_kwargs["ignore"].append("good_weather")

If there is no dome attribute then we should be in a fail safe mode and check for weather safety. This should work fine if using a simulated dome, but if not then it is a bug with the dome simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants