PlasmaPy / PlasmaPy-PLEPs

A repository for PlasmaPy Enhancement Proposals
http://docs.plasmapy.org/
Other
8 stars 6 forks source link

Add PLEP 6 on new structure for Plasma class #14

Closed SolarDrew closed 5 years ago

SolarDrew commented 6 years ago

PLEP outlining the rationale and implementation for a big refactor of how Plasma works, to replace it with a metaclass system. WIP but discussion welcome.

SolarDrew commented 6 years ago

I'm not familiar with it, but that's good :) In what way is it similar (so I know if you've understood correctly from my description)?

StanczakDominik commented 6 years ago

Well, scikit-learn has all of their machine learning models - random trees, linear regressions, SVCs, classifiers - literally every single model of theirs as far as I know - under a common interface. Each of them (up to slight differences such as classifiers vs regressions) provides .fit, .predict, .score, .get_params, .fit_transform etc. methods... I'm not 100% sure how they achieve it, but I think it might be via reasonably written metaclasses - and this is looking pretty similar.

SolarDrew commented 6 years ago

Ah ok. Yes, that does sound pretty much exactly like what I'm proposing.

namurphy commented 6 years ago

One minor thing to note related to importing abstract base classes that I noticed in the "What's new for Python 3.7" docs:

In Python 3.8, the abstract base classes in collections.abc will no longer be exposed in the regular collections module. This will help create a clearer distinction between the concrete classes and the abstract base classes.

I think this means that we won't be able to do things like this:

import collections
collections.abc

and will have to specifically import collections.abc.

StanczakDominik commented 5 years ago

@SolarDrew, do you think this is ready for a vote? We're thinking vote by email since telecon attendance was a bit low today :smile:

namurphy commented 5 years ago

I vote in support!

tulasinandan commented 5 years ago

I'm in favor :+1:

namurphy commented 5 years ago

An aside: Should we change this to PLEP 6 instead of PLEP 7? We had tentatively reserved PLEP 6 for data structures, though I don't know if we're still planning on writing that.

SolarDrew commented 5 years ago

I vote in favour.