You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently initialisation is distributed between lines of code in main.py (to read a config file) and GeometryMaker.parse_json in geometry_maker.py. This distribution will make it harder to be consistent between use of main.py and in-memory invocation of the API.
Suggested implementation
It is reasonable to have a config.json for run settings, and a geometry.json for parameters. However since the outcome of reading config.json only affects the subsequently instantiated GeometryMaker it might make more sense to internalise these functions, and provide them as arguments to the class.
These could be optional arguments, for users who simply wish to run with default parameters.
Geometry maker would then require two methods, say read_config and read_geometry_params.
These would be called at the end of GeometryMaker.__init__().
The functions that produce the geometry should really be in one function, personally I'd call this generate, and would be the union of make_geometry and imprint_and_merge. Having done this, the method file_to_merged_geometry is probably obsolete at this point.
There should be one high level export that exports everything that has been requested in the config.
main.py would become extremely simple, just parsing the 2 input json file names from command line, and would just need to call
(Also I think the high level API should avoid reference to cubit, to future proof against ever changing the back end, so suggest renaming reset_cubit to reset.)
The text was updated successfully, but these errors were encountered:
Description
Currently initialisation is distributed between lines of code in
main.py
(to read a config file) andGeometryMaker.parse_json
ingeometry_maker.py
. This distribution will make it harder to be consistent between use of main.py and in-memory invocation of the API.Suggested implementation
It is reasonable to have a config.json for run settings, and a geometry.json for parameters. However since the outcome of reading config.json only affects the subsequently instantiated GeometryMaker it might make more sense to internalise these functions, and provide them as arguments to the class.
These could be optional arguments, for users who simply wish to run with default parameters.
Geometry maker would then require two methods, say
read_config
andread_geometry_params
.These would be called at the end of
GeometryMaker.__init__()
.The functions that produce the geometry should really be in one function, personally I'd call this
generate
, and would be the union ofmake_geometry
andimprint_and_merge
. Having done this, the methodfile_to_merged_geometry
is probably obsolete at this point.There should be one high level export that exports everything that has been requested in the config.
main.py
would become extremely simple, just parsing the 2 input json file names from command line, and would just need to callThe usage where the parameters are being changed on the fly would be almost identical, just
(Also I think the high level API should avoid reference to cubit, to future proof against ever changing the back end, so suggest renaming
reset_cubit
toreset
.)The text was updated successfully, but these errors were encountered: