Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5d771cd
skeleton for analysis
andped10 Oct 24, 2024
6844a12
report to summary
andped10 Oct 24, 2024
48e39b4
moving files
andped10 Oct 24, 2024
115dc17
more file moving
andped10 Oct 24, 2024
4a2924b
most of advanced pane is hooked up to backend
andped10 Oct 25, 2024
a057d97
calculated and measured show up on analysis
andped10 Oct 25, 2024
5d35579
minor corrections
andped10 Oct 25, 2024
1e6b57c
skeleton in python is functional
andped10 Oct 25, 2024
41d6841
more analysis gui
andped10 Oct 25, 2024
f292ee4
fitables are still missing
andped10 Oct 28, 2024
e224045
most parts of analysis GUI seems to work towards mock backend
andped10 Oct 28, 2024
bdea399
mouseArea and usage of index rathet than currentIndex
andped10 Oct 28, 2024
d0b7488
towards only updating when changes are applied
andped10 Oct 28, 2024
a700950
python skeleton for analysis
andped10 Oct 28, 2024
8a90681
more skeleton work
andped10 Oct 28, 2024
aaf3cfc
minimizer seeems functional
andped10 Oct 31, 2024
a3408f6
code cleaning calculators functional
andped10 Oct 31, 2024
fc084b0
parameter table on analysis seems to work
andped10 Nov 1, 2024
2476ea5
fitting table and fitting function running
andped10 Nov 1, 2024
729fa52
sample behaves better
andped10 Nov 4, 2024
4deb337
code cleaning
andped10 Nov 4, 2024
f67b058
code cleaning
andped10 Nov 5, 2024
e358a8d
plots for refl and sld are made on startup
andped10 Nov 5, 2024
26dde86
experiements data shown
andped10 Nov 5, 2024
42e7671
more responsive, status bar and analysis is updated
andped10 Nov 6, 2024
07f013e
fittable with better names
andped10 Nov 6, 2024
e4de68b
reset button is active after sample page
andped10 Nov 6, 2024
5f08d7e
code cleaning an external signals
andped10 Nov 7, 2024
0bddccc
code cleaning and better signalling
andped10 Nov 7, 2024
5d11890
code cleaning
andped10 Nov 7, 2024
eb508b3
advanced tab sample skeleton
andped10 Nov 7, 2024
947330a
skeleton constraints
andped10 Nov 7, 2024
48384e8
Q range to sample logic
andped10 Nov 7, 2024
bdf009c
code cleaning
andped10 Nov 7, 2024
86a173b
constraints seem to work
andped10 Nov 8, 2024
0610bfb
load and save project
andped10 Nov 9, 2024
8e498b9
fixing loading a json
andped10 Nov 11, 2024
71fc306
add model
andped10 Nov 11, 2024
7ecf7a4
code cleaning
andped10 Nov 13, 2024
c20c800
new add model and cleaning
andped10 Nov 13, 2024
c1d4772
get name for minimizer
andped10 Nov 15, 2024
8535a40
Fitter to MultiFitter
andped10 Nov 15, 2024
f6ba7ef
easy_f to easy_science_multi_fitter
andped10 Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EasyReflectometryApp/Logic/Proxies/Calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def currentCalculatorIndex(self, new_index: int):
model = self.parent._data_proxy._data[self.parent._data_proxy.currentDataIndex].model

model.switch_interface(new_name)
self.parent._fitter_proxy.eFitter.easy_f.initialize(self.parent._model_proxy._model,
self.parent._fitter_proxy.eFitter.easy_science_multi_fitter.initialize(self.parent._model_proxy._model,
self.parent._interface.fit_func)
self.calculatorChanged.emit()

Expand Down
4 changes: 2 additions & 2 deletions EasyReflectometryApp/Logic/Proxies/Fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from easyscience import global_object

from easyreflectometry.fitting import Fitter as easyFitter
from easyreflectometry.fitting import MultiFitter as easyFitter


class Fitter(QThread):
Expand Down Expand Up @@ -148,7 +148,7 @@ def nonthreaded_fit(self):
weights = [1 / i.ye for i in exp_data]
method = self.parent.minimizer._current_minimizer.method

res = self.eFitter.easy_f.fit(x, y, weights=weights, method=method)
res = self.eFitter.easy_science_multi_fitter.fit(x, y, weights=weights, method=method)
self._setFitResults(res)

# def threaded_fit(self):
Expand Down
4 changes: 2 additions & 2 deletions EasyReflectometryApp/Logic/Proxies/Minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def minimizerNames(self):

@Property(int, notify=currentMinimizerChanged)
def currentMinimizerIndex(self):
current_name = self.parent._fitter_proxy.eFitter.easy_f.minimizer.name
current_name = self.parent._fitter_proxy.eFitter.easy_science_multi_fitter.minimizer.name
return self.minimizerNames.index(current_name)

@currentMinimizerIndex.setter
Expand All @@ -41,7 +41,7 @@ def currentMinimizerIndex(self, new_index: int):
if self.currentMinimizerIndex == new_index:
return
new_name = self.minimizerNames[new_index]
self.parent._fitter_proxy.eFitter.easy_f.switch_minimizer(new_name)
self.parent._fitter_proxy.eFitter.easy_science_multi_fitter.switch_minimizer(new_name)
self.currentMinimizerChanged.emit()

@Property(int, notify=currentMinimizerMethodChanged)
Expand Down
2 changes: 1 addition & 1 deletion EasyReflectometryApp/Logic/Proxies/Parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def toggleConstraintByIndex(self, index, enabled):
self.parent.sampleChanged.emit()

def removeAllConstraints(self):
for _ in range(len(self.eFitter.easy_f.fit_constraints())):
for _ in range(len(self.eFitter.easy_science_multi_fitter.fit_constraints())):
self.removeConstraintByIndex(0)
self.constraintsRemoved.emit()
self.sampleChanged.emit()
Expand Down
4 changes: 2 additions & 2 deletions EasyReflectometryApp/Logic/Proxies/State.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def statusModelAsObj(self):
"calculation":
self.parent._interface.current_interface_name,
"minimization":
f'{self.parent._fitter_proxy.eFitter.easy_f.minimizer._method}'
f'{self.parent._fitter_proxy.eFitter.easy_science_multi_fitter.minimizer._method}'
}
self._status_model = obj
return obj
Expand All @@ -63,7 +63,7 @@ def statusModelAsXml(self):
"label":
"Minimization",
"value":
f'{self.parent._fitter_proxy.eFitter.easy_f.minimizer._method}'
f'{self.parent._fitter_proxy.eFitter.easy_science_multi_fitter.minimizer._method}'
}]
xml = XMLSerializer().encode({"item":model}, data_only=True)
return xml
Expand Down
94 changes: 94 additions & 0 deletions src_qt6/EasyReflectometryApp/Backends/Mock/Analysis.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,101 @@ pragma Singleton
import QtQuick

QtObject {
readonly property var minimizersAvailable: ['minimizer_1', 'minimizer_2', 'minimizer_3']
readonly property int minimizerCurrentIndex: 0

readonly property var calculatorsAvailable: ['calculator_1', 'calculator_2', 'calculator_3']
readonly property int calculatorCurrentIndex: 1

readonly property var experimentsAvailable: ['experiment_1', 'experiment_2', 'experiment_3']
readonly property int experimentCurrentIndex: 2

// Minimizer
readonly property double minimizerTolerance: 1.0
readonly property int minimizerMaxIterations: 2

// Fitting
readonly property string fittingStatus: ''//undefined //'Success'
readonly property bool isFitFinished: true
readonly property bool fittingRunning: false

// Parameters
property int currentParameterIndex: 0
readonly property int modelParametersCount: 10
readonly property int experimentParametersCount: 20
readonly property int freeParametersCount: 100
readonly property int fixedParametersCount: 200
readonly property var fitableParameters: [
{
'name': 'name 1',
'value': 1.0,
'error': -1.23456,
'max': 100.0,
'min': -100.0,
'units': 'u1',
'fit': true,
'from': -10.0,
'to': 10.0,
},
{
'name': 'name 2',
'value': 2.0,
'error': -2.34567,
'max': 200.0,
'min': -200.0,
'units': 'u2',
'fit': false,
'from': -20.0,
'to': 20.0,
},
{
'name': 'name 3',
'value': 3.0,
'error': -3.45678,
'max': 300.0,
'min': -300.0,
'units': 'u3',
'fit': true,
'from': -30.0,
'to': 30.0,
},
]
function setCurrentParameterMin(value) {
console.debug(`setCurrentParameterMin ${value}`)
}
function setCurrentParameterMax(value) {
console.debug(`setCurrentParameterMax ${value}`)
}
function setCurrentParameterValue(value) {
console.debug(`setCurrentParameterValue ${value}`)
}
function setCurrentParameterFit(value) {
console.debug(`setCurrentParameterFit ${value}`)
}

// Setters
function setCurrentParameterIndex(value) {
currentParameterIndex = value
console.debug(`setCurrentParameterIndex ${value}`)
}
function setCalculatorCurrentIndex(value) {
console.debug(`setCalculatorCurrentIndex ${value}`)
}
function setExperimentCurrentIndex(value) {
console.debug(`setExperimentCurrentIndex ${value}`)
}
function setMinimizerCurrentIndex(value) {
console.debug(`setMinimizer ${value}`)
}
function setMinimizerTolerance(value) {
console.debug(`setMinimizerTolerance ${value}`)
}
function setMinimizerMaxIterations(value) {
console.debug(`setMinimizerMaxIterations ${value}`)
}

//Actions
function fittingStartStop() {
console.debug('fittingStartStop')
}
}
14 changes: 0 additions & 14 deletions src_qt6/EasyReflectometryApp/Backends/Mock/Experiment.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ QtObject {
property double background: 2.
property string resolution: '3.00'

property double q_min: 4.
property double q_max: 5.
property int q_resolution: 6

// Setters
function setScaling(value) {
console.debug(`setScaling ${value}`)
Expand All @@ -23,16 +19,6 @@ QtObject {
console.debug(`setResolution ${value}`)
}

function setQMin(value) {
console.debug(`setQMin ${value}`)
}
function setQMax(value) {
console.debug(`setQMax ${value}`)
}
function setQElements(value) {
console.debug(`setQElements ${value}`)
}

function load(path) {
console.debug(`Loading experiment from ${path}`)
}
Expand Down
21 changes: 17 additions & 4 deletions src_qt6/EasyReflectometryApp/Backends/Mock/Plotting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ QtObject {
property double sldMaxX: 2.
property double sldMinY: -20.
property double sldMaxY: 20.
property double experimentMinX: -2.
property double experimentMaxX: 2.
property double experimentMinY: -20.
property double experimentMaxY: 20.
property double experimentMinX: -3.
property double experimentMaxX: 3.
property double experimentMinY: -30.
property double experimentMaxY: 30.
property double analysisMinX: -4.
property double analysisMaxX: 4.
property double analysisMinY: -40.
property double analysisMaxY: 40.

function setQtChartsSerieRef(value1, value2, value3) {
console.debug(`setQtChartsSerieRef ${value1}, ${value2}, ${value3}`)
}

function drawCalculatedOnSampleChart(){
console.debug(`drawCalculatedOnSampleChart`)
}

function drawCalculatedOnSldChart(){
console.debug(`drawCalculatedOnSldChart`)
}

}
31 changes: 30 additions & 1 deletion src_qt6/EasyReflectometryApp/Backends/Mock/Sample.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QtQuick

QtObject {
// MATERIALS
property int currentMaterialIndex: -1
readonly property int currentMaterialIndex: -1

// Getters
readonly property var materials: [
Expand Down Expand Up @@ -264,4 +264,33 @@ QtObject {
function moveSelectedLayerDown() {
console.debug(`moveSelectedLayerDown ${currentLayerIndex}`)
}

// Constraints
readonly property var parameterNames: [
'parameter 1',
'parameter 2',
'parameter 3'
]
readonly property var relationOperators: ['=', '&lt', '&gt']
readonly property var arithmicOperators: ['', '*', '/', '+', '-']

function addConstraint(value1, value2, value3, value4, value5) {
console.debug(`addConstraint ${value1} ${value2} ${value3} ${value4} ${value5}`)
}

// Q Range
property double q_min: 4.
property double q_max: 5.
property int q_resolution: 6

// Setters
function setQMin(value) {
console.debug(`setQMin ${value}`)
}
function setQMax(value) {
console.debug(`setQMax ${value}`)
}
function setQElements(value) {
console.debug(`setQElements ${value}`)
}
}
Loading
Loading