Closed NucciTheBoss closed 1 day ago
Really liking the new structure! I think it's a lot better to have the parsing methods available directly on the models, since it could enable interesting abstractions around that.
I agree with that! It'll be nice to have a similar API to the json
and yaml
modules with the load
, loads
, dump
, and dumps
methods, but also still be able to enable developers to write their own abstractions around the Slurm data models.
Going to open follow up PR with the vbump and updates to the README
This PR refactors how the models are parsed and marshalled to and from their respective configuration file formats (string) into a data model that Python can understand.
The TL;DR is that now, if you want a data model in its configuration file format, all you have to do is just call
str
:If you want to construct a data model from a string, you can use the alternative constructor
from_str
:This removes the need for the intermediary
_parse
and_marshall
functions that were defined as part of each editor.