-
Notifications
You must be signed in to change notification settings - Fork 9
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
Visual implementation #27
Conversation
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.
A few comments, currently I can't run it yet on my machine because of imports etc.
I'd also suggest to merge main into this first given the changes from #26 |
…o visual_implementation
Ah, one more thought: Maybe we can add a minimal example of this to the README.md with a screenshot of what it looks like? This seems like the kind of feature user would really want to know how to use :) |
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.
a few more comments, in general I still think it would be nice to add a minimal example (like below) with a screenshot to the readme.md for users
I still can't run it outside the module with e.g.
import paseos
import pykep as pk
from paseos import SpacecraftActor,ActorBuilder
earth = pk.planet.jpl_lp('earth')
# Define local actor
sat1 = ActorBuilder.get_actor_scaffold(
"sat1", SpacecraftActor, [10000000, 0, 0], pk.epoch(0)
)
ActorBuilder.set_orbit(sat1, [10000000, 0, 0], [0, 8000.0, 0], pk.epoch(0), earth)
ActorBuilder.set_power_devices(sat1, 500, 10000, 1)
# init simulation
sim = paseos.init_sim(sat1)
from paseos import SpaceAnimation
anim = SpaceAnimation(sim)
anim.animate(sim, "paseos_test", 200, 400)
I get [Errno 2] No such file or directory: '/home/pablo/ESA/PASEOS/my_notebooks/FontAwesome.otf'
due the path not being relative (see here how to do it:
PASEOS/paseos/utils/load_default_cfg.py
Line 12 in 2f2d7c3
os.path.dirname(__file__) + "/../../resources/", "default_cfg.toml" |
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.
Good news:
- For me I get the exact same experience on Win & Linux
- In both cases, in a jupyter notebook works
Bad news:
On my windows machine, if I run the example/visualization/example_animation.py
I get this
On Linux it doesn't even open the window and just shows me briefly a blank screen window at the end.
But I have one more fundamental question, because I am starting to wonder how we interface this with the activities and user actions. Because then, you don't want to call something that blocks you from interacting with paseos?
It should be more like:
# Some setup code
# plot the current animation frame
paseos.plot()
# user can do some actions, activities whatever they want
# plot the next frame
paseos.plot( )
What do you think? @johanos1
paseos/power/is_in_eclipse.py
Outdated
@@ -21,7 +21,7 @@ def is_in_eclipse( | |||
Returns: | |||
bool: True if actor is in eclipse | |||
""" | |||
logger.debug(f"Checking whether {actor} is in eclipse at {t}.") | |||
logger.debug(f"Checking whether {actor} is in eclipse at {t.mjd2000/pk.SEC2DAY}.") |
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.
Please revert 🙏
let's highlight local actor in special color |
- Preparing NB for finalization
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
some minor changes
paseos/paseos.py
Outdated
@@ -95,7 +95,6 @@ def add_known_actor(self, actor: BaseActor): | |||
@property | |||
def local_actor(self) -> BaseActor: | |||
"""Returns the local actor. | |||
|
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.
Please revert these white space changes. There should be an empty line after description to follow https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
paseos/power/is_in_eclipse.py
Outdated
@@ -21,7 +21,7 @@ def is_in_eclipse( | |||
Returns: | |||
bool: True if actor is in eclipse | |||
""" | |||
logger.debug(f"Checking whether {actor} is in eclipse at {t}.") | |||
logger.debug(f"Checking whether {actor} is in eclipse at {t.mjd2000/pk.SEC2DAY}.") |
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.
Still open
We also need to explain somewhere what you actually see in the visualization. Especially what the blue ball is, what the green / red matrix is and why some actors have different colors. Probably in the readme? 🤔 |
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.
👍 Only very minor string changes in readme I would still apply 🙏 We did it, yay! 🛰️ 🚀
Co-authored-by: Pablo Gómez <contact@pablo-gomez.net>
Co-authored-by: Pablo Gómez <contact@pablo-gomez.net>
Co-authored-by: Pablo Gómez <contact@pablo-gomez.net>
Co-authored-by: Pablo Gómez <contact@pablo-gomez.net>
Description
Summary of changes
Resolved Issues
How Has This Been Tested?
Related Pull Requests