Skip to content
Snippets Groups Projects
Commit 4c054494 authored by Edward Fauchon-Jones's avatar Edward Fauchon-Jones
Browse files

Remove anti-pattern of classmethods

The `Spec` class family were originally set up to work using class
methods. This was natural because each `Spec` derivative only
represented a single field.

With the addition of the `Amplm` and `Phaselm` specs, this was no longer
true, with each of these specs required to represent a collection of
fields. While initially attempted to use instances for these `Specs` and
classes+classmethods for the remaining specs, to much off the logic
required casing on the `Spec` being an instance of class, it was decided
to only use classes and classmethods.

In the end this resulting in a massive anti-pattern, defining a class
factory in place of instance initialisers in the `Amplm` and `Phaselm`
classes, and a general bad logic. It made sense to use classmethods
before, but in no longer did.

This commit refactors most classmethods as instance methods (with a
couple left as classmethods because theydo not reference the parent
object, and could infact be staic methods). While a couple of
expressions required additional `()` to instance `Specs`, overall the
logic has been greatly simplified and actually demonstrated that the
classmethod paradigm previously used had significantly little benifit.
parent 63de1fb9
No related branches found
No related tags found
2 merge requests!4WIP: Gitlab CI Experiments,!3Validate strain modes #2
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment