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

simpler way to create a new catalog #77

Merged
merged 8 commits into from
Sep 20, 2022
Merged

simpler way to create a new catalog #77

merged 8 commits into from
Sep 20, 2022

Conversation

RondeauG
Copy link
Contributor

@RondeauG RondeauG commented Sep 19, 2022

Pull Request Checklist:

  • pre-commit hooks are installed/active in my local clone ($ pre-commit install)
  • This PR addresses an already opened issue (for bug fixes / features)
  • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • If a merge request has been made in parallel to this PR in xscen-notebooks, it is merged and the submodules have been updated.
  • HISTORY.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • Adds a create argument to ProjectCatalog():
    • ProjectCatalog("path.json", create=True, project=project, overwrite=False) (default) will only create a new catalog if one doesn't already exist. If it exists, it will drop the creation-specific kwargs and open the JSON normally.
    • ProjectCatalog("path.json", create=True, project=project, overwrite=True) will create a new catalog, overwriting if necessary.
    • Any version without create will work as previously and crash if the file doesn't exist.

Does this PR introduce a breaking change?

No.

Other information:

xscen/catalog.py Outdated Show resolved Hide resolved
@RondeauG RondeauG merged commit fc6922e into main Sep 20, 2022
@RondeauG RondeauG deleted the cat-create branch September 20, 2022 16:04
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

Successfully merging this pull request may close these issues.

Simplify ProjectCatalog.create()
2 participants