-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make sequencer constraint #378
Merged
Merged
Changes from 5 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1ebfa58
Make sequencer constraint
jermainegug 497b4dd
*can't use scheduler here (try observation)
jermainegug 7623a69
*edit
jermainegug beac373
Change names
jermainegug 2260d04
Start making test for constraint
jermainegug b9f7877
Edits
jermainegug 440a466
*fix indent typo
jermainegug f4ab18e
*put return into function
jermainegug cfce422
*import OrderedDict
jermainegug c8e118e
*initialize observed_list to be empty
jermainegug 0c72b44
Couple fixups
jermainegug 86c6f55
*not checking observation.field
jermainegug 71735ab
*try for loop
jermainegug 4548b9b
*fix typos
jermainegug 8106c11
*put print to see what observed_list looks like
jermainegug dcfba36
Hopefully final fix!
jermainegug aa6abe0
*try dict instead of OrderedDict
jermainegug b50a07d
*change back to OrderedDict
jermainegug e33509e
*add sentence in class description
jermainegug 773d2b3
*don't need import OrderedDict in constraint.py
jermainegug 25b1a3e
*avoid loop
jermainegug 5b7b6fe
Edit the scheduler playground
jermainegug 5c0b274
Fixing issue with observed_list
jermainegug 732e041
Merge branch 'develop' into make-new-constraint
jermainegug fd78307
*pass observed_list into get_score for already visited constraint
jermainegug 058bc65
*put observed_list into get_score
jermainegug f2cba6c
Undo commit
jermainegug 37c9616
*update shceduler notebook
jermainegug 8072579
*use field instead of seq_time
jermainegug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
from pocs.scheduler.constraint import BaseConstraint | ||
from pocs.scheduler.constraint import Duration | ||
from pocs.scheduler.constraint import MoonAvoidance | ||
from pocs.scheduler.constraint import AlreadyVisited | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -197,3 +198,24 @@ def test_moon_avoidance(observer): | |
|
||
assert veto1 is False and veto2 is False | ||
assert score2 > score1 | ||
|
||
|
||
def test_already_visited(observer): | ||
avc = AlreadyVisited() | ||
|
||
time = Time('2016-08-13 10:00:00') | ||
|
||
observation1 = Observation(Field('HD189733', '20h00m43.7135s +22d42m39.0645s')) # HD189733 | ||
observation2 = Observation(Field('Hat-P-16', '00h38m17.59s +42d27m47.2s')) # Hat-P-16 | ||
observation3 = Observation(Field('Sabik', '17h10m23s -15d43m30s')) # Sabik | ||
|
||
observed_list = OrderedDict() | ||
|
||
observed_list[observation1.seq_time] = observation1 | ||
observed_list[observation2.seq_time] = observation2 | ||
|
||
veto1, score1 = avc.get_score(time, observer, observation1, observed_list=observed_list) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An alternative to passing the |
||
veto2, score2 = avc.get_score(time, observer, observation3, observed_list=observed_list) | ||
|
||
assert veto1 is True | ||
assert veto2 is False |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For normal operations you'll still want to pull from
observation.observed_list
as that's how the scheduler builds it up. So do akwargs.get('observed_list', observation.observed_list)
here.