implement to_writer method and clean up RustCycle csv serde #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
to_writer
methodto_writer
instead ofto_file
write_csv
etc)RustCycle::to_csv
function to be consistent withto_yaml
etc, same functionality asRustCycle::to_str("csv")
(which now callsRustCycle::to_csv
)IOError
/OSError
in Python rather thanRuntimeError
I noticed the Python-exposed
RustCycle::from_csv
loads a cycle from a given filepath, rather than a string likefrom_yaml
,from_json
, etc. I think this is something that I would definitely want to change in FASTSim 3. @calbaker what are your thoughts about making all these string deserialization methods have_str
at the end (starting in FASTSim 3, to avoid API changes)?i.e.
from_yaml
would becomefrom_yaml_str
to make it clear that it takes a YAML-formatted string, rather than a filepath