MetaCell / geppetto-scidash

Geppetto scidash extension
2 stars 1 forks source link

Fix for sciunit.settings module error #510

Closed rgerkin closed 3 years ago

rgerkin commented 3 years ago

Today in the meeting @zsinnema showed (via Sentry) an API upload issue, which I think is related to using the current release of SciUnit (not the metacell branch). The issue is shown here in Sentry. There are two possible fixes:

  1. You guys can use the sciunit.config_set function instead of sciunit.settings dict, i.e. change the offending line to sciunit.config_set('PREVALIDATE', True).

or

  1. If for some reason you want to keep using sciunit.settings (and maybe other sciunit dependencies out there want to use it as well) I can add something like this for backwards compatibility:
class _Settings_BWC:
    def __getitem__(self, attr):
        return sciunit.config_get(attr)
    def __setitem__(self, attr, value):
        return sciunit.config_set(attr, value)

sciunit.settings = Settings_BWC()

and then you can use sciunit.settings with the same behavior as before.

zsinnema commented 3 years ago

@rgerkin thanks for this!