gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Mixin classes cannot have __init__ methods #56

Closed al-maisan closed 13 years ago

al-maisan commented 13 years ago

This makes pylint unhappy in certain cases, example:

openquake/risk/job/probabilistic.py: [W0232, ProbabilisticEventMixin] Class has no init method openquake/risk/job/probabilistic.py: [W0201, ProbabilisticEventMixin.epsilon] Attribute 'samples' defined outside init

al-maisan commented 13 years ago

The above is slightly misleading, I meant we should consider refactoring our job system to make use of dependency injection techniques as opposed to monkey patching python's internal class structures. The current approach pushes us further down a path where we have to do more magic/weird things etc.

kpanic commented 13 years ago

I'm diving into the current mixin mechanism (for the Classical PSHA Based Mixin story), it is interesting, but maybe it's too much involved to grasp it immediately, IMHO we should keep things more straightforward to understand, also from an external contributor point of view

mbarbon commented 13 years ago

Moved to LP https://blueprints.launchpad.net/openquake/+spec/mixin-removal