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

Design user-friendly API for GeometryMaker #16

Open
helen-brooks opened this issue Apr 5, 2024 · 1 comment
Open

Design user-friendly API for GeometryMaker #16

helen-brooks opened this issue Apr 5, 2024 · 1 comment

Comments

@helen-brooks
Copy link
Collaborator

It may be worth considering precisely which functions you wish to expose to the user. For example, consider the following example:

https://github.com/sid-mungale/blobmaker/blob/cdfcf70a09772307e4e5306b95726c8653791796/examples/make_breeder_unit.py#L8-L14

Do you think a given user will ever want to call these independently? I.e. most users probably won't want a geometry that is not imprinted and merged?

If the answer is no, then it might be worth having a convenience member function along the lines

def initialise(self, json_file):
   self.parse_json(json_file)
   self.make_geometry()
   self.imprint_and_merge()

Exporting mesh and CAD file feel like they are separate steps, so that could probably stay as is.

Then a typical example would be very minimal

maker = GeometryMaker()

maker.initialise("input.json")

maker.export_geometry("output.cub5", ".")

It may be nice to consider if what other convenience functions (if any) a user might need, maybe dumping metadata information.

@lukethehuman
Copy link
Collaborator

Consider using config files for initialising classes like GeometryMaker.

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

No branches or pull requests

2 participants