You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 1.1.2 of the EasyScience we rely on the class Objects.Inferface.InterfaceFactoryTemplate to obtain functionality to determine the result/response from a sample. In reflectometry these results/responses are the reflectivity curve and the SLD curve. The current solution allows the user to change between different physics calculators by switching the state of the "Factory".
There are several issues with the current setup:
The name Interface way to generic and even misleading. Instead it should be Calculator
Another challenge with the generic naming approach is that the main method is called fit_func that is complete non-explanatory
It is confusing that the code part is called a Factory since it doesn't produce any objects as expected from a factory pattern
Not sure, but create actually seems to produce an interface (calculator)
Its state is complex to maintain (which physical calculator that is being used)
It has complicated dependencies (generate_bindings)
Might even have to update the Fitter
In an attempt to simplify the calculator functionality the following changes are suggested:
Change towards a setup similar to fitting.minimizers where the factory is only responsible for producing the requested calculator object
No state information should be hold be the factory
The produced calculator would correspond to one and only one physical model
The constructor for the produced calculator should take a model/sample as its main argument
Only able to do single point calculations for this provided model/sample
Could have method to update the model/sample
The produced calculator should probably have a method with a generic name that would be called when doing fitting
Can be ensured by having an base class for the calculators where this method is defined as abstract
At the EasyScience level it will probably only be a matter of defining the calculator base class and defining an abstract base factory to ensure that such calculator objects are returned
The concrete calculator factory would be implemented in the product specific EasyXXXLib repo similar to where the interfaces (calculators) are implemented
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In version 1.1.2 of the
EasySciencewe rely on the classObjects.Inferface.InterfaceFactoryTemplateto obtain functionality to determine the result/response from a sample. In reflectometry these results/responses are thereflectivitycurve and theSLDcurve. The current solution allows the user to change between different physics calculators by switching the state of the "Factory".There are several issues with the current setup:
Interfaceway to generic and even misleading. Instead it should beCalculatorfit_functhat is complete non-explanatoryFactorysince it doesn't produce any objects as expected from a factory patterncreateactually seems to produce an interface (calculator)generate_bindings)FitterIn an attempt to simplify the calculator functionality the following changes are suggested:
fitting.minimizerswhere the factory is only responsible for producing the requested calculator objectEasySciencelevel it will probably only be a matter of defining the calculator base class and defining an abstract base factory to ensure that such calculator objects are returnedEasyXXXLibrepo similar to where the interfaces (calculators) are implementedBeta Was this translation helpful? Give feedback.
All reactions