SiEPIC-Tools icon indicating copy to clipboard operation
SiEPIC-Tools copied to clipboard

get_technology_by_name function crashes when cml file doesn't have _v in the name

Open JinWallner opened this issue 4 years ago • 2 comments

For v0.3.70 and v0.3.71, the get_technology_by_name function expects the cml file with the naming convention name_vxxx.cml. If there are some cml files not following the naming convention, the get_technology_by_name function will crash. Can we have a default version in case the cml file name doesn't have _v?

Thanks,

Jin

JinWallner avatar Dec 23 '20 18:12 JinWallner

Sure, do you have a suggestion? We can also skip the CML file, and leave it as “None” for a default.

lukasc-ubc avatar Dec 24 '20 19:12 lukasc-ubc

Hi Lukas,

In the get_technolgy_by_name function, can we replace the following line at 2 locations

*cml_name, cml_version = file.split('_v', 1) *

with

  • try:*

  • cml_name, cml_version = file.split('_v', 1)*

  • except:*

  • cml_name=file[:-4]*

  • cml_version="default.cml"*

It seems to fix my technology loading issue when there are cml files but the cml file name doesn't have '_v' in it. I am not sure the default version needs to be anything special for any downstream process. The code already handles technology without any cml files.

Thanks,

Jin

On Thu, Dec 24, 2020 at 2:15 PM Lukas Chrostowski [email protected] wrote:

Sure, do you have a suggestion? We can also skip the CML file, and leave it as “None” for a default.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SiEPIC/SiEPIC-Tools/issues/137#issuecomment-750948326, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCAQLQBRE4YZFC4W6MSPP3SWOHOFANCNFSM4VHKCQ7Q .

JinWallner avatar Dec 28 '20 16:12 JinWallner