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

creating to_pydict and from_pydict methods in fastsim-2 #170

Draft
wants to merge 2 commits into
base: fastsim-2
Choose a base branch
from

Conversation

robinsteuteville
Copy link
Collaborator

@robinsteuteville robinsteuteville commented Dec 2, 2024

@robinsteuteville
Copy link
Collaborator Author

robinsteuteville commented Dec 2, 2024

@calbaker I added from_pydict and to_pydict methods and added them to the RustVehicle struct. A couple notes:

  1. I have yet to figure out how to implement the methods for fastsim.vehicle.Vehicle, so they can only be used with either to_rust after the instantiation or using fsr.RustVehicle (see the demo file I created for a working example). The issue I ran into was that there was no method from_json or to_json for fastsim.vehicle.Vehicle.
  2. I am happy to manually add code to implement the methods for additional Rust structs, however, if we want the methods to automatically be added to all FASTSim Rust structs, ideally we would use the automatically created ACCEPTED_RUST_STRUCTS list. This is currently used in FASTSim-3, however, when taking the same code and exploring with it to see if a similar code could work in FASTSim-2, I found that the FASTSim-3 code did not work -- I've confirmed that the same code does work in FASTSim-3, so I'll have to do some more exploring to figure out what needs to change for the FASTSim-2 version. So far I haven't had any luck figuring out what will work.
  3. test_fetch_github_list is failing, but this may be a broader issue rather than branch specific.

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