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

Add skip_init option to SerdeAPI from_* methods #123

Merged
merged 1 commit into from
May 7, 2024

Conversation

kylecarow
Copy link
Collaborator

Add option to skip initialization to resolve https://github.nrel.gov/MBAP/fastsim/issues/319

@kylecarow kylecarow added the bug Something isn't working label May 6, 2024
@kylecarow kylecarow requested a review from calbaker May 6, 2024 21:57
@@ -859,7 +859,7 @@ def copy_vehicle(veh: Vehicle, return_type: str = None, deep: bool = True) -> Di
veh_dict = {key: to_native_type(veh_dict[key]) for key in veh_dict if key not in [
"large_baseline_eff", "small_baseline_eff"]}
veh_yaml = yaml.dump(veh_dict)
v = RustVehicle.from_yaml(veh_yaml)
v = RustVehicle.from_yaml(veh_yaml, skip_init=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@calbaker This did end up fixing the issue!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sweet! Looks like you ended up covering all the from_ cases, right? I'm going to go ahead and approve.

@calbaker calbaker merged commit b6db185 into fastsim-2 May 7, 2024
3 checks passed
@calbaker calbaker deleted the f2/to-rust-debug branch May 7, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants