quaquel / EMAworkbench

workbench for performing exploratory modeling and analysis
BSD 3-Clause "New" or "Revised" License
128 stars 90 forks source link

Use PlatypusConfig.default_variator #369

Closed dhadka closed 2 months ago

dhadka commented 2 months ago

Version 1.3.0 moved default_variator from a standalone method to part of PlatypusConfig. Thus, this updates the method reference and puts a minimum version on the dependency.

Alternatively, if you want to allow either version, you could use something like:


def default_variator(problem):
    try:
        return PlatypusConfig.default_variator(problem)
    except AttributeError:
        from platypus import default_variator
        return default_variator(problem)
EwoutH commented 2 months ago

Thanks a lot for not only getting back, but also directly suggesting/implementing two potential fixes!

@quaquel, for your context, this PR originated from an issue I filed to Platypus after seeing our weekly CI fail: https://github.com/Project-Platypus/Platypus/issues/246

quaquel commented 2 months ago

Thanks @dhadka! I'll take a closer look as soon as possible.

dhadka commented 2 months ago

FYI, I've decided to put those methods back since it's a breaking change, but probably with a warning to switch to the new methods. I should have the version out in the next few hours. Though I would still recommend switching to the class version eventually.

EwoutH commented 2 months ago

Thanks! The diligent follow ups are really appreciated!

@quaquel we have two options:

  1. Accept this PR and set Platypus 1.3 (or 1.3.1) as minimum version
  2. Use the other suggestion with the try-except block
quaquel commented 2 months ago

I am fine with option 1, requires updating the toml I guess?

EwoutH commented 2 months ago

Yes, and this PR also already does that!

Thanks @dhadka, really appreciated.

@quaquel we probably want to release a bugfix release. Anything else that should be in there?

quaquel commented 2 months ago

@quaquel we probably want to release a bugfix release. Anything else that should be in there?

checking all closed PRs since 2.5 in December, nothing seems API breaking and #307 which is massively breaking 2.x is not merged yet, so I think we can just include all PRs since the last release.