gdsfactory / kfactory

gdsfactory with a klayout backend
https://gdsfactory.github.io/kfactory/
MIT License
34 stars 13 forks source link

change some warnings to debug #479

Closed joamatab closed 2 months ago

joamatab commented 2 months ago

image

sebastian-goeldi commented 2 months ago

Why though? I think this is legit if we are using a newer version of klayout than the gui of klive?

sebastian-goeldi commented 2 months ago

The layout_cache we can move to debug

joamatab commented 2 months ago

because we use klayout as a viewer, not as an editor, so it's not super important to warn for any version mismatches

for example, the versions i use are always slightly older than the latest so i always get those warnings

sebastian-goeldi commented 2 months ago

Yes, until you have people use klayout 0.27.9 or something like that and wonder why the gds is empty. And if someone is using <0.28.10, they will have problems reading some metainfos afaik (maybe that's only on write but I am not sure).

And these things are barely a year old. So, no I don't really want to hide this by default. If you think it's too noisy then raise to level ERROR. I feel we are currently relying too much on new klayout features to just decrease to debug.

If you really want to decrease this, then fine, but add the klayout -V output to the gf settings and please make a PR to allow the same for kfactory, although there we don't need all the gf plugin checks.

joamatab commented 2 months ago

I already sent a PR for kfactory

If you want to raise a warning for previous versions that have issues it's okay with me

I have got that feedback from gdsfactory users and I agree with it so I made the PR

sebastian-goeldi commented 2 months ago

I don't agree with it at all. If you want the program less noisy, raise the logging level, the logfilter isn't there just to look pretty.

If we follow anything like general logging guidlines like this https://sematext.com/blog/logging-levels/ , the version mismatch should be a warning. global layout cache is debatable. I would still argue it should be, but I guess that's more of a different working mode.

Add something like this to the docs and users can choose themselves:

""" In order to decrease the noise level, you can create an env file which will set the loglevel to error or above. This means generally, the application will only output information if something happened which almost certainly creates a malformed layout file or even none at all

bash -c 'echo "kfactory_logfilter_level = \" ERROR\" >> .env"'

or python

from pathlib import Path

p = Path().parent.resolve() / ".env"

with p.open("a") as f:
    f.write('kfactory_logfilter_level = "ERROR"')

""""

joamatab commented 2 months ago

I changed it to a warning for a dangerous versions (<=0.27)

let me know if that looks good for you

also, can you review the PR? https://github.com/gdsfactory/kfactory/pull/480