ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
213 stars 129 forks source link

Add "ignore errors" flag to import_materials_from_file #5306

Open isaacwaldron opened 1 month ago

isaacwaldron commented 1 month ago

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

SMoraisAnsys commented 1 month ago

@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 ?

SMoraisAnsys commented 3 weeks ago

@isaacwaldron Do you still plan to work on this ? Btw, I'd go with keeping the same signature if possible.