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

Simplify config instantiation #57

Merged
merged 7 commits into from
Apr 14, 2023
Merged

Simplify config instantiation #57

merged 7 commits into from
Apr 14, 2023

Conversation

surajpaib
Copy link
Collaborator

Description

This PR simplifies the instantiation of a configuration by refactoring the existing code and making it more user-friendly. Monai bundle scripts are avoided and configuration parsers are used to separate from monai's structure and error-handling

Related Issue

N/A

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.

@ibro45
Copy link
Collaborator

ibro45 commented Apr 11, 2023

Awesome, thank you! Can we just not use assert, and instead raise errors?

Btw, from PL 2.0, Trainer has not .tune() method, and instead you'd have to use the Tuner class. We'll have to modify the code for that but that can be a separate PR.

@surajpaib
Copy link
Collaborator Author

Awesome, thank you! Can we just not use assert, and instead raise errors?

Assert would also raise an error, right? Do we want to have specific error codes?

@ibro45
Copy link
Collaborator

ibro45 commented Apr 11, 2023

Just style concerns, i think asserts are usually for debugging and testing purposes

@surajpaib
Copy link
Collaborator Author

Got it, will make the edit!

@ibro45
Copy link
Collaborator

ibro45 commented Apr 13, 2023

Thanks! Btw how do the error messages look like now, is it better or do we still have to figure that out?

@surajpaib
Copy link
Collaborator Author

surajpaib commented Apr 13, 2023

Thanks! Btw how do the error messages look like now, is it better or do we still have to figure that out?

This fixes it. Those error messages were thrown because we not only instantiated our config, but also called it through monai config.

Now these two are de-coupled

@surajpaib surajpaib marked this pull request as ready for review April 13, 2023 13:47
@ibro45 ibro45 merged commit 7698cd1 into main Apr 14, 2023
@ibro45 ibro45 deleted the monai_config_patch branch April 14, 2023 14:30
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.

2 participants