ansys / pyedb-core

Ansys Electronics Database Python Client Package
https://edb.core.docs.pyansys.com/
MIT License
3 stars 1 forks source link

PadstackDefData(pin.data).get_pad_parameters() return errors if PadType is not defined #316

Closed svandenb-dev closed 2 weeks ago

svandenb-dev commented 11 months ago

🔍 Before submitting the issue

🐞 Description of the bug

When we request pad parameters from PadstackDefData and there is no Pad defined the API returns an error. For instance

image

but requesting antipad parameters thrown error. If no antipad is present the API should handle it.

image

📝 Steps to reproduce

from unittest

def test_set_all_antipad_values(self): """Set all anti-pads from all pad-stack definition to the given value.""" source_path = os.path.join(local_path, "example_models", test_subfolder, "ANSYS-HSD_V1.aedb") target_path = os.path.join(self.local_scratch.path, "test_0120.aedb") self.local_scratch.copyfolder(source_path, target_path) edbapp = EdbGrpc(target_path, edbversion=desktop_version) assert edbapp.padstacks.set_all_antipad_value(0.0) edbapp.close()

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.10

📦 Installed packages

pyedb-core
drewm102 commented 7 months ago

@svandenb-dev This was the intended behavior on our side in the sense that we thought the user would use a try/except block. In the scenario where the pad params aren't defined for that particular request, the exception thrown by the server would be caught and handled on the client side. Alternatively, we could return an empty tuple instead. Which behavior would you prefer?

drewm102 commented 2 weeks ago

@svandenb-dev I'm closing this for now since it is expected behavior as I described in my last comment. Feel free to reopen it if you feel that changes are necessary.