Skip to content

Commit 552edd5

Browse files
authored
Merge pull request #91 from easyScience/0.0.5rc
0.0.5rc
2 parents 1eb8ce0 + 34d77ae commit 552edd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3496
-1595
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# CHANGELOG
22

3+
### Changes 0.0.5
4+
5+
- Addition of multiple contrast support [091abe1](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/091abe1b727c7b9e1f1b60ed1327d79ef318dd8e)
6+
- Saving and loading fixed [598e7f3](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/598e7f36ef5feb6263ed015e13002528c15b03b9)
7+
- Enabling parameter-parameter constraints to be defined [82e3821](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/82e382141e8e5b469e89fe42ca397c21bd194fcc)
8+
- Clean up of the sample interface [3907bde](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/3907bde69d608be6b82051c60bb7a304f04f0002)
9+
- Enabling the docs and bug reporting buttons [7d29276](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/7d292761e96860b5b8ce74365174e38f79bbaf80)
10+
- Fix the reset state button [a1db4ac](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/a1db4ac10bbd5f90c764f28336cbfecb26671a03)
11+
- Parameter quick filters [27a64b6](https://github.com/easyScience/EasyReflectometryApp/pull/79/commits/27a64b615d016713478817119e45133b4af50695)
12+
- Start using easyApp [5e38ef8](https://github.com/easyScience/EasyReflectometryApp/commit/5e38ef8bd6fa542edd89e3c687d3a84dcc803800)
13+
- Add plotting in R(q)q^4 [5e38ef8](https://github.com/easyScience/EasyReflectometryApp/commit/5e38ef8bd6fa542edd89e3c687d3a84dcc803800)
14+
- Make the plots colourful to match the model colours [225ac06](https://github.com/easyScience/EasyReflectometryApp/pull/81/commits/225ac06cd7a72ba91a71e1c339c774fa351f1802)
15+
- Disable the fitting button if no parameters are `fixed == False` [45be44c](https://github.com/easyScience/EasyReflectometryApp/pull/90/commits/45be44c35cdfefa6e311929cdf2ab4a0512b88f6)
16+
- Saving plots to a single pdf [da7eba6](https://github.com/easyScience/EasyReflectometryApp/pull/89/commits/da7eba6c2acc23dd9b04d2fc5b51e3421e913820)
17+
- Remove the colour from the materials as it isn't used [7a40613](https://github.com/easyScience/EasyReflectometryApp/pull/88/commits/7a40613d07a021f0440a46105843f9fabe945430)
18+
319
### Changes 0.0.4
420

521
- Add min and max columns to the Analysis tab [da47432](https://github.com/easyScience/EasyReflectometryApp/commit/da47432db1bec0e16e587328a24c23bdd174c099)

CONTRIBUTING.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ Once you have completed the feature and commited your changes, please open a pul
3434
## Release workflow
3535

3636
Periodically, or after the additional of major new features, there will be stable releases of `EasyReflectometryApp`.
37-
These should be produced firstly by bumping the version number in the `develop` branch appropriately and updating the [CHANGELOG.md](./CHANGELOG.md).
38-
The files where the version numbers should be changed are:
39-
- `pyproject.toml`
40-
- `README.md`
41-
- `INSTALLATION.md`
42-
Once the version number is bumped and the resulting build EasyReflectometry application is tested, a branch should be taken from `develop` for the release candidate.
43-
This branch should be named `<version-number>rc` and a lock file for the poetry package management should be produced and commited to the repository using
44-
45-
```
46-
poetry lock
47-
git add -f package.lock
48-
git commit -m 'Lock package versions'
49-
```
50-
51-
Once the Githib builds have been completed, these should also be tested.
52-
53-
If all is well, then a pull request can be opened to merge the `<version-number>rc` branch into the `main` branch.
54-
With this pull request merged the final version will be built from `main` and the `<version-number>rc` branch can be removed.
55-
The final `main` branch action will then run to build the release version of EasyReflectometry, this will produce a release in the [releases](https://github.com/easyScience/EasyReflectometryApp/releases) section of the Github repository.
56-
Once is it there, the release should be tagged and renamed, this is achieved by selecting the 'edit' button (the pencil).
57-
The tag should be given as `v<version-number>` and the name of the release should be "Version <version-number> (<date>)` and currently (until new tutorials are produced) the tutorial should be removed from the release.
58-
Finally, the release should be published.
37+
These should be produced firstly by:
38+
1. Bumping the version number in the `develop` branch appropriately and updating the [CHANGELOG.md](./CHANGELOG.md).
39+
The files where the version numbers should be changed are:
40+
- `pyproject.toml`
41+
- `README.md`
42+
- `INSTALLATION.md`
43+
44+
This should be allowed to build on Github and the resulting application tested.
45+
2. Then a branch should be taken from `develop` for the release candidate, named `<version-number>rc`. If there has been changes to `EasyReflectometryLib:main`, the `pyproject.toml` should be changed to use the `main` branch rather than `develop` of `EasyReflectometryLib`. Then a lock file for the poetry package management should be produced and commited to the repository using
46+
47+
```
48+
poetry lock
49+
git add -f poetry.lock pyproject.toml
50+
git commit -m 'Lock package versions'
51+
```
52+
53+
3. Once the `<version-number>rc` Github builds have been completed, these should also be tested.
54+
4. Then a pull request can be opened to merge the `<version-number>rc` branch into the `main` branch and tested, at this stage the CHANGELOG.md information for the given release should be copy-and-pasted into the PR.
55+
5. Once this pull request is merged, the final version will be built from `main` and the `<version-number>rc` branch can be removed (locally).
56+
6. The final `main` branch action will then run to build the release version of EasyReflectometry, this will produce a release in the [releases](https://github.com/easyScience/EasyReflectometryApp/releases) section of the Github repository.
57+
7. Once is it there, the release should be tagged and renamed, this is achieved by selecting the 'edit' button (the pencil). The tag should be given as `v<version-number>` and the name of the release should be `Version <version-number> (<date>)` and currently (until new tutorials are produced) the tutorial should be removed from the release.
58+
8. Finally, the release should be published.

EasyReflectometryApp/Gui/Components/AnalysisConstraints.qml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import QtQuick 2.13
22
import QtQuick.Controls 2.13
33
import QtQuick.XmlListModel 2.13
44

5-
import easyAppGui.Globals 1.0 as EaGlobals
6-
import easyAppGui.Style 1.0 as EaStyle
7-
import easyAppGui.Elements 1.0 as EaElements
8-
import easyAppGui.Components 1.0 as EaComponents
5+
import easyApp.Gui.Globals 1.0 as EaGlobals
6+
import easyApp.Gui.Style 1.0 as EaStyle
7+
import easyApp.Gui.Elements 1.0 as EaElements
8+
import easyApp.Gui.Components 1.0 as EaComponents
99

1010
import Gui.Globals 1.0 as ExGlobals
1111

@@ -17,11 +17,12 @@ EaComponents.TableView {
1717
// Table model
1818

1919
model: XmlListModel {
20-
///xml: ExGlobals.Constants.proxy.constraintsListAsXml
20+
xml: ExGlobals.Constants.proxy.parameter.constraintsAsXml
2121

2222
query: "/root/item"
2323

2424
XmlRole { name: "number"; query: "number/number()" }
25+
XmlRole { name: "index"; query: "index/number()" }
2526
XmlRole { name: "dependentName"; query: "dependentName/string()" }
2627
XmlRole { name: "relationalOperator"; query: "relationalOperator/string()" }
2728
XmlRole { name: "value"; query: "value/number()" }
@@ -54,6 +55,15 @@ EaComponents.TableView {
5455
deleteRowColumn.width) / 2
5556
headerText: "Constraint"
5657
text: model.dependentName
58+
elide: Text.ElideRight
59+
ToolTip.text: model.dependentName
60+
ToolTip.visible: model.dependentName ? ma.containsMouse : false
61+
MouseArea {
62+
id: ma
63+
anchors.fill: parent
64+
hoverEnabled: true
65+
}
66+
ToolTip.delay: 500
5767
}
5868

5969
EaComponents.TableViewLabel {
@@ -67,8 +77,8 @@ EaComponents.TableView {
6777
EaComponents.TableViewLabel {
6878
id: valueColumn
6979
horizontalAlignment: Text.AlignRight
70-
width: EaStyle.Sizes.fontPixelSize * 4
71-
text: model.value.toFixed(4)
80+
width: EaStyle.Sizes.fontPixelSize * 2
81+
text: model.value.toFixed(2)
7282
}
7383

7484
EaComponents.TableViewLabel {
@@ -84,22 +94,31 @@ EaComponents.TableView {
8494
horizontalAlignment: Text.AlignLeft
8595
width: dependentNameColumn.width
8696
text: model.independentName
97+
elide: Text.ElideRight
98+
ToolTip.text: model.independentName
99+
ToolTip.visible: model.independentName ? mai.containsMouse : false
100+
MouseArea {
101+
id: mai
102+
anchors.fill: parent
103+
hoverEnabled: true
104+
}
105+
ToolTip.delay: 500
87106
}
88107

89108
EaComponents.TableViewCheckBox {
90109
id: useColumn
91110
width: EaStyle.Sizes.fontPixelSize * 3
92111
headerText: "Use"
93112
checked: model.enabled
94-
onToggled: ExGlobals.Constants.proxy.toggleConstraintByIndex(model.index, checked)
113+
onToggled: ExGlobals.Constants.proxy.parameter.toggleConstraintByIndex(model.index, checked)
95114
}
96115

97116
EaComponents.TableViewButton {
98117
id: deleteRowColumn
99118
headerText: "Del." //"\uf2ed"
100119
fontIcon: "minus-circle"
101120
ToolTip.text: qsTr("Remove this constraint")
102-
onClicked: ExGlobals.Constants.proxy.removeConstraintByIndex(model.index)
121+
onClicked: ExGlobals.Constants.proxy.parameter.removeConstraintByIndex(model.index-1)
103122
}
104123
}
105124

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
import QtQuick 2.13
22

3-
import easyAppGui.Style 1.0 as EaStyle
4-
import easyAppGui.Charts 1.0 as EaCharts
3+
import easyApp.Gui.Style 1.0 as EaStyle
4+
import easyApp.Gui.Charts 1.0 as EaCharts
55

6+
import Gui.Components 1.0 as ExComponents
67
import Gui.Globals 1.0 as ExGlobals
78

8-
EaCharts.BaseBokeh {
9+
ExComponents.BaseBokeh {
910
measuredData: ExGlobals.Constants.proxy.plotting1d.bokehMeasuredDataObj
1011
calculatedData: ExGlobals.Constants.proxy.plotting1d.bokehCalculatedDataObj
11-
sldData: ExGlobals.Constants.proxy.plotting1d.bokehSldDataObj
12+
sldData: ExGlobals.Constants.proxy.plotting1d.bokehAnalysisSldDataObj
1213

1314
plotRanges: ExGlobals.Constants.proxy.plotting1d.analysisPlotRangesObj
14-
sldPlotRanges: ExGlobals.Constants.proxy.plotting1d.sldPlotRangesObj
15+
sldPlotRanges: ExGlobals.Constants.proxy.plotting1d.analysisSldPlotRangesObj
1516

1617
xMainAxisTitle: "q (Å⁻¹)"
17-
yMainAxisTitle: {
18-
let title = 'R(q)calc'
19-
if (hasMeasuredData) title = 'R(q)meas, R(q)calc'
20-
return title
21-
}
18+
yMainAxisTitle: ExGlobals.Constants.proxy.simulation.yMainAxisTitle
2219
xSldAxisTitle: "z (Å)"
2320
ySldAxisTitle: "SLD (10⁻⁶Å⁻²)"
2421

22+
calculatedLineColor: ExGlobals.Constants.proxy.data.experimentColor
23+
sldLineColor: ExGlobals.Constants.proxy.data.experimentColor
24+
measuredLineColor: ExGlobals.Constants.proxy.data.experimentColor
25+
measuredAreaColor: ExGlobals.Constants.proxy.data.experimentColor
26+
2527
Component.onCompleted: ExGlobals.Variables.analysisChart = this
2628
}
2729

EasyReflectometryApp/Gui/Components/AnalysisDataChartQtCharts.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import QtQuick 2.13
22

3-
import easyAppGui.Charts 1.0 as EaCharts
3+
import easyApp.Gui.Charts 1.0 as EaCharts
44

55
import Gui.Globals 1.0 as ExGlobals
66

EasyReflectometryApp/Gui/Components/AnalysisFitables.qml

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import QtQuick 2.13
22
import QtQuick.Controls 2.13
33
import QtQuick.XmlListModel 2.13
44

5-
import easyAppGui.Globals 1.0 as EaGlobals
6-
import easyAppGui.Style 1.0 as EaStyle
7-
import easyAppGui.Elements 1.0 as EaElements
8-
import easyAppGui.Components 1.0 as EaComponents
5+
import easyApp.Gui.Globals 1.0 as EaGlobals
6+
import easyApp.Gui.Style 1.0 as EaStyle
7+
import easyApp.Gui.Elements 1.0 as EaElements
8+
import easyApp.Gui.Components 1.0 as EaComponents
99

1010
import Gui.Globals 1.0 as ExGlobals
1111

@@ -69,7 +69,15 @@ EaComponents.TableView {
6969
fitColumn.width
7070
headerText: "Label"
7171
text: formatLabel(model.index, model.label)
72-
textFormat: Text.RichText
72+
elide: Text.ElideRight
73+
ToolTip.text: formatLabel(model.index, model.label)
74+
ToolTip.visible: formatLabel(model.index, model.label) ? mac.containsMouse : false
75+
MouseArea {
76+
id: mac
77+
anchors.fill: parent
78+
hoverEnabled: true
79+
}
80+
ToolTip.delay: 500
7381
}
7482

7583
EaComponents.TableViewTextInput {
@@ -79,9 +87,13 @@ EaComponents.TableView {
7987
headerText: "Value"
8088
text: {
8189
if (model.label.endsWith('Background')) {
82-
model.value.toExponential(3)
90+
model.value.toExponential(2)
8391
} else {
84-
model.value.toFixed(4)
92+
if (model.label.endsWith('background')) {
93+
model.value.toExponential(2)
94+
} else {
95+
model.value.toFixed(3)
96+
}
8597
}
8698
}
8799
onEditingFinished: editParameterValue(model.id, text)
@@ -90,17 +102,33 @@ EaComponents.TableView {
90102
EaComponents.TableViewLabel {
91103
id: unitColumn
92104
horizontalAlignment: Text.AlignLeft
93-
width: EaStyle.Sizes.fontPixelSize * 2
94-
text: model.unit
105+
width: EaStyle.Sizes.fontPixelSize * 3.5
106+
text: {
107+
if (model.unit == '1/Ų') {
108+
'10⁻⁶Å⁻²'
109+
} else {
110+
model.unit
111+
}
112+
}
95113
color: EaStyle.Colors.themeForegroundMinor
96114
}
97115

98116
EaComponents.TableViewLabel {
99117
id: errorColumn
100118
horizontalAlignment: Text.AlignRight
101-
width: EaStyle.Sizes.fontPixelSize * 3
102-
headerText: "Error "
103-
text: model.error === 0.0 || model.error > 999999 ? "" : model.error.toFixed(4) + " "
119+
width: EaStyle.Sizes.fontPixelSize * 4
120+
headerText: "Error"
121+
text: {
122+
if (model.label.endsWith('Background')) {
123+
model.error === 0.0 || model.error > 999999 ? "" : model.error.toExponential(2)
124+
} else {
125+
if (model.label.endsWith('background')) {
126+
model.error === 0.0 || model.error > 999999 ? "" : model.error.toExponential(2)
127+
} else {
128+
model.error === 0.0 || model.error > 999999 ? "" : model.error.toFixed(3)
129+
}
130+
}
131+
}
104132
}
105133

106134
EaComponents.TableViewTextInput {
@@ -174,10 +202,7 @@ EaComponents.TableView {
174202
if (index < 0 || typeof label === "undefined")
175203
return ""
176204

177-
const datasetName = ExGlobals.Constants.proxy.data.experimentDataAsObj[0].name
178-
179205
// Modify current label
180-
label = label.replace("Instrument.", `Instrument.${datasetName}.`)
181206
label = label.replace(".background.", ".")
182207
label = label.replace("Uiso.Uiso", "Uiso")
183208
label = label.replace("fract_", "fract.")
@@ -191,7 +216,6 @@ EaComponents.TableView {
191216

192217
// Modify previous label to list
193218
let previousLabel = index > 0 ? fitablesModel.get(index - 1).label : ""
194-
previousLabel = previousLabel.replace("Instrument.", `Instrument.${datasetName}.`)
195219
previousLabel = previousLabel.replace(".background.", ".")
196220
previousLabel = previousLabel.replace("Uiso.Uiso", "Uiso")
197221
previousLabel = previousLabel.replace("fract_", "fract.")

0 commit comments

Comments
 (0)