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

Add "ignore errors" flag to import_materials_from_file #5306

Open
isaacwaldron opened this issue Oct 16, 2024 · 1 comment
Open

Add "ignore errors" flag to import_materials_from_file #5306

isaacwaldron opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
enhancement New features or code improvements

Comments

@isaacwaldron
Copy link
Contributor

isaacwaldron commented Oct 16, 2024

Description of the feature

Customer has requested a flag to allow ignoring errors that occur when importing materials with import_materials_from_file, e.g. missing keys that are treated as required. When successful, the method currently returns a list of the names of the imported materials. If backwards compatibility is desired, we could retain the existing return signature and expect the user to compare the imported materials against the expected values (i.e. the keys of the JSON's materials dictionary). If not required, we could extend the return signature to return an additional list of materials that could not be imported due to error.

Steps for implementing the feature

  1. Add an ignore_errors flag to the method call signature, defaulting to False.
  2. (Optional) add materials_failed_to_import sequence of material names to method return signature.
  3. Implement logic to ignore errors during material read, optionally retaining a list of material names that failed to import.

Useful links and references

No response

@isaacwaldron isaacwaldron added the enhancement New features or code improvements label Oct 16, 2024
@SMoraisAnsys
Copy link
Collaborator

@isaacwaldron You seem to be pretty up to date with the problem, would you like to work on it ? :D
If not, could you add an example of data provided by a user with missing keys ?

@isaacwaldron isaacwaldron self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

No branches or pull requests

2 participants