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

Dynamic class creation on python api #25

Open
thesamprice opened this issue Dec 1, 2021 · 2 comments
Open

Dynamic class creation on python api #25

thesamprice opened this issue Dec 1, 2021 · 2 comments

Comments

@thesamprice
Copy link

Would you be open to dynamic class creation in the ball cosmos python api?
This would let tab completion work in ipython, and it makes scripting easier.

ie in python .

cosmos = CosmosSystem()

print(cosmos.Targets.TargetName.Tlm.TlmPacketName.TlmPacketPoint.value)

# Wait for packet
cosmos.Targets.TargetName.Tlm.TlmPacketName.Wait()

# Command example
cmd = cosmos.Targets.TargetName.Cmd.CmdPacketName()
cmd.cmd_value = 3
cmd.Send()
@ghost
Copy link

ghost commented Dec 2, 2021

Hello thanks for your interest in the ballcosmos library for cosmos. Currently the deign of the library is to be as similar to the ruby library so users can read both without having to know major differences. I think this is a good idea, but I think this is better for a separate library . Something we can expand on going into cosmosc2 for cosmos v5.

@thesamprice
Copy link
Author

Ok, i have something prototyped that does this using dynamic class creation / setattr / getattr calls.
Ping me when / if this would be useful.
Feel free to close the issue.

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

No branches or pull requests

1 participant