AlessandroLovo / general_purpose

Set of general purpose python functions
MIT License
2 stars 0 forks source link

AttributeError: module 'general_purpose.utilities' has no attribute 'keys_exists' #9

Closed georgemilosh closed 1 year ago

georgemilosh commented 1 year ago

I've noticed this today while running an old script of Climate-Learning:

==Reading data==
Traceback (most recent call last):
  File "/mnt/homedafs-2.10/gmiloshe/Climate-Learning/VAE/analogue_george.py", line 167, in <module>
    if (ut.keys_exists(run_vae_kwargs, 'label_period_start') and ut.keys_exists(run_vae_kwargs, 'label_period_end')):
AttributeError: module 'general_purpose.utilities' has no attribute 'keys_exists'

Did you change something?

georgemilosh commented 1 year ago

No I think it is something else...

AlessandroLovo commented 1 year ago

There were breaking changes in the fix of #6. For the matter at hand, keys_exists was renamed to key_exists

georgemilosh commented 1 year ago

That does break a lot of things. Should be possible to include a wrapper for the old method

AlessandroLovo commented 1 year ago

yes, I'll do it stat

AlessandroLovo commented 1 year ago

Please read the other breaking changes that were introduced for #6 and tell me if they make problems for you

AlessandroLovo commented 1 year ago

I added back the keys_exists method. But if you can, I recommend rather doing replace all in the files involved. The name of the function was misleading, as it checks only one key, so I'd rather not stick around with it too much