Skip to content

Add Nyx Python tutorials - #46

Merged
ChristopherRabotin merged 2 commits into
masterfrom
nyx-tutorials-4734355618943678767
Jul 2, 2026
Merged

Add Nyx Python tutorials#46
ChristopherRabotin merged 2 commits into
masterfrom
nyx-tutorials-4734355618943678767

Conversation

@ChristopherRabotin

Copy link
Copy Markdown
Member

Adds new Nyx python tutorials covering mission design, orbit determination, and spacecraft definition, based on existing Python test files. Includes documentation site navigation updates.


PR created automatically by Jules for task 4734355618943678767 started by @ChristopherRabotin

- Added tutorial for Mission Design based on `test_mission_design.py`.
- Added tutorial for Orbit Determination based on `test_orbit_determination.py`.
- Added tutorial for Spacecraft Definition based on `test_spacecraft.py`.
- Included index page for the Tutorials section.
- Updated mkdocs.yml navigation to include the new tutorials under the Nyx section.

Co-authored-by: ChristopherRabotin <4823784+ChristopherRabotin@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 4dcd409):

https://nyx-space--pr46-nyx-tutorials-473435-wxe5ck5y.web.app

(expires Wed, 08 Jul 2026 22:19:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: ecf6068ed4b2d3d429c02e3ebe5890356e4315eb

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Tutorials section to the documentation, adding guides for Mission Design, Orbit Determination, and Spacecraft Definition, along with updating the navigation configuration. The review feedback highlights opportunities to clean up the tutorial code examples by removing unused imports, standardizing the import path for Epoch across files, and using keyword arguments consistently for better readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +10 to +11
import logging
from nyx_space import DragData, ExportCfg, Mass, Spacecraft, SRPData

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The logging module is imported but never used in this tutorial. It should be removed to keep the code clean.

Suggested change
import logging
from nyx_space import DragData, ExportCfg, Mass, Spacecraft, SRPData
from nyx_space import DragData, ExportCfg, Mass, Spacecraft, SRPData

Comment on lines +21 to +36
from nyx_space.orbit_determination import (
GroundStation,
GroundTrackingArcSim,
Handoff,
KalmanVariant,
LocalFrame,
Location,
MeasurementType,
ProcessNoise,
Scheduler,
SigmaRejection,
SpacecraftEstimate,
SpacecraftODProcess,
StochasticNoise,
TrkConfig,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

SigmaRejection is imported from nyx_space.orbit_determination but never used in the tutorial. It should be removed.

Suggested change
from nyx_space.orbit_determination import (
GroundStation,
GroundTrackingArcSim,
Handoff,
KalmanVariant,
LocalFrame,
Location,
MeasurementType,
ProcessNoise,
Scheduler,
SigmaRejection,
SpacecraftEstimate,
SpacecraftODProcess,
StochasticNoise,
TrkConfig,
)
from nyx_space.orbit_determination import (\n GroundStation,\n GroundTrackingArcSim,\n Handoff,\n KalmanVariant,\n LocalFrame,\n Location,\n MeasurementType,\n ProcessNoise,\n Scheduler,\n SpacecraftEstimate,\n SpacecraftODProcess,\n StochasticNoise,\n TrkConfig,\n)

Comment on lines +106 to +112
gs1 = GroundStation(
"Denver, CO",
Location(
39.7420, -104.9915, 1.8, Frames.IAU_EARTH_FRAME.to_frameuid(), [], True
),
stochastic_noises,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and readability, it is recommended to use keyword arguments when defining gs1 and its Location, matching the style used for gs0.

Suggested change
gs1 = GroundStation(
"Denver, CO",
Location(
39.7420, -104.9915, 1.8, Frames.IAU_EARTH_FRAME.to_frameuid(), [], True
),
stochastic_noises,
)
gs1 = GroundStation(\n name=\"Denver, CO\",\n location=Location(\n latitude_deg=39.7420,\n longitude_deg=-104.9915,\n height_km=1.8,\n frame=Frames.IAU_EARTH_FRAME.to_frameuid(),\n terrain_mask=[],\n terrain_mask_ignored=True,\n ),\n stochastic_noises=stochastic_noises,\n)

from nyx_space.anise.analysis import OrbitalElement
from nyx_space.anise.astro import Orbit
from nyx_space.anise.constants import Frames
from nyx_space.anise.time import Epoch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other tutorials (such as mission_design.md and orbit_determination.md), Epoch should be imported from nyx_space.time instead of nyx_space.anise.time.

Suggested change
from nyx_space.anise.time import Epoch
from nyx_space.time import Epoch

almanac = MetaAlmanac.latest()

# Define Atmospheric Drag. We use the MSIS-00 empirical atmosphere model.
drag = Drag(AtmDensity.msis00())

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no MSIS00 drag model in Nyx yet. It's also missing some parameters. Use verbatim

drag = Drag(
AtmDensity.earth_exponential(),
almanac.frame_info(Frames.IAU_EARTH_FRAME),
estimate=False,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updated the drag configuration to use earth_exponential with the correct arguments.

od_dev_sol = od_proc_deviation.process_arc(estimate, trk_arc)

# Export the whole orbit determination solution into a single Parquet file.
od_dev_sol.to_parquet("od_dev_smoothed.pq", ExportCfg(False))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Export this X od_dev.pq (remove the smoothed keyword).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed the export file name to od_dev.pq.

- Use earth_exponential for Drag model in mission_design tutorial instead of MSIS00.
- Use `od_dev.pq` instead of `od_dev_smoothed.pq` in orbit_determination tutorial.

Co-authored-by: ChristopherRabotin <4823784+ChristopherRabotin@users.noreply.github.com>
@ChristopherRabotin
ChristopherRabotin merged commit fb835f3 into master Jul 2, 2026
2 checks passed
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.

1 participant