Skip to content

Comments

Inital spice manager for time conversion#3

Merged
samaloney merged 5 commits intoi4Ds:masterfrom
samaloney:feat-spice
Nov 20, 2020
Merged

Inital spice manager for time conversion#3
samaloney merged 5 commits intoi4Ds:masterfrom
samaloney:feat-spice

Conversation

@samaloney
Copy link
Collaborator

No description provided.

@samaloney samaloney marked this pull request as ready for review November 11, 2020 20:58
@codecov-io
Copy link

codecov-io commented Nov 11, 2020

Codecov Report

Merging #3 (7db4e42) into master (b014a12) will decrease coverage by 1.03%.
The diff coverage is 96.96%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master       #3      +/-   ##
===========================================
- Coverage   100.00%   98.96%   -1.04%     
===========================================
  Files            2        3       +1     
  Lines           64       97      +33     
===========================================
+ Hits            64       96      +32     
- Misses           0        1       +1     
Impacted Files Coverage Δ
stixcore/ephemeris/manager.py 96.96% <96.96%> (ø)

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 b014a12...7db4e42. Read the comment docs.

@samaloney samaloney force-pushed the feat-spice branch 3 times, most recently from 80e4a25 to 6ca5047 Compare November 12, 2020 09:03
@samaloney samaloney marked this pull request as draft November 12, 2020 10:21
@samaloney samaloney marked this pull request as ready for review November 12, 2020 17:43
self.mk_path = Path(meta_kernel_path)
*_, datestamp, version = self.mk_path.name.split('_')
self.kernel_date = datetime.strptime(datestamp, '%Y%m%d')
spice.furnsh(str(meta_kernel_path))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think as spicepy is a wrapper around the CSPICE library it appears to be global in that kernels loaded in one module / function will be available anywhere spicepy is imported. A actual context manager might be a better approach but not sure.

Comment on lines +107 to +115
if isinstance(datetime, Time):
datetime = datetime.to_datetime()
et = spice.datetime2et(datetime)
Copy link
Collaborator

Choose a reason for hiding this comment

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

a type check might help in long term
crashes with: datetime_to_scet(1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can add a check to make sure its a string, it's not very pythonic in general but in this case probably makes sense.

Copy link
Collaborator

@nicHoch nicHoch left a comment

Choose a reason for hiding this comment

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

would suggest some more type checks in the time conversion functions.

i am not sure how it will resolve: in #2

all the example_module files are already gone here they axist again.

@samaloney
Copy link
Collaborator Author

would suggest some more type checks in the time conversion functions.

i am not sure how it will resolve: in #2

all the example_module files are already gone here they axist again.

Yea once #2 is merged this PR will become invalid and I'll have to update to match master so will pick up these changes

@samaloney samaloney merged commit c44ea16 into i4Ds:master Nov 20, 2020
@samaloney samaloney deleted the feat-spice branch November 20, 2020 09:11
nicHoch pushed a commit to nicHoch/STIXCore that referenced this pull request Mar 1, 2021
Inital spice manager for time conversion
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.

3 participants