Skip to content

Commit dc1e7fb

Browse files
andped10rozyczkoarm61
authored
Update dependencies and pipeline cleaning (#164)
* some fixes related to model add/remove * xmltodict -> XMLSerializer + other assorted fixes * experiment-less analysis now allows for calculator change * Allow experiment-less projects to be loaded * Fixed project info layout * make sure model view is updated on project reset. Normally, this would be another slot in the main proxy, but we are introducing race condition for the projectInfoChanged signal and it's better to explicitly call the updater. * Update INSTALLATION.md * Fixed proper display of layers * Update ROADMAP.md added example project files task * updates after meeting with Jos * more effort at the start of 2024 * easyreflectometrylib v0.0.3 * use version 0.0.7-beta for development * remove version pinning * revert change * require python 3.9 * pinning scipy and pyinstaller to minor version * alphabetic sorting and fix syntax error * version pinning syntax * rename pipelines and comments * bump version description * revert triggers from master to main * change display name * pr response --------- Co-authored-by: Piotr Rozyczko <[email protected]> Co-authored-by: Andrew McCluskey <[email protected]>
1 parent 6f24203 commit dc1e7fb

24 files changed

+155
-108
lines changed

.github/workflows/documentation_build.yml renamed to .github/workflows/documentation-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
name: Build Documentation
1+
# This pipeline
2+
# - build developer documentation
3+
# - push documentation to gh-pages branch of the same repository
4+
#
5+
# Deployment is handled by pages-build-deployment bot
6+
#
7+
# This pipeline DOES NOT build the end-user page
8+
9+
name: Build Documentation and Push to gh-pages Branch
210

311
on:
412
push:
5-
branches: [ main, develop ]
13+
branches: [ main ]
614

715
workflow_dispatch:
816

.github/workflows/snapcraft.yml renamed to .github/workflows/linux-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
name: Build Snap Image
1+
# This pipeline
2+
# - build executeable for Ubuntu Linux
3+
# - for main branch executeable is deployed to snapcraft stable
4+
# - for develop branch executeable is deployed to snapcraft beta
5+
6+
name: Build Snap Image for Ubuntu Linux
27

38
on: [push, pull_request]
49

.github/workflows/build_executable.yml renamed to .github/workflows/macos-windows-build.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
name: Build Executable
1+
# This pipeline
2+
# - build executeable for MacOS
3+
# - build executeable for Windows
4+
# - for main executeables are deployed
5+
# -- offline installers to GitHub releases
6+
# -- online installers FTP server
7+
8+
name: Build Executable for MacOS and Windows
29

310
on: [push, pull_request]
411

@@ -65,7 +72,7 @@ jobs:
6572
run: python ${{ env.SCRIPTS_PATH }}/MakeInstaller.py ${{ secrets.BINARY_SIGN_WIN }} ${{ secrets.CERT_ZIP_PASS }}
6673

6774
- name: Create online app installers
68-
if: github.event_name == 'push' && env.BRANCH_NAME == 'master'
75+
if: github.event_name == 'push' && env.BRANCH_NAME == 'main'
6976
run: python ${{ env.SCRIPTS_PATH }}/MakeOnlineInstaller.py ${{ secrets.BINARY_SIGN_WIN }} ${{ secrets.CERT_ZIP_PASS }}
7077

7178
# - name: Sign the installer
@@ -95,8 +102,8 @@ jobs:
95102
name: windows
96103
path: "${{ env.DISTRIBUTION_PATH }}/${{ env.APP_NAME }}_Windows_*.zip"
97104

98-
- name: Upload zipped offline app installer to GitHub releases (master only)
99-
if: github.event_name == 'push' && env.BRANCH_NAME == 'master'
105+
- name: Upload zipped offline app installer to GitHub releases (main only)
106+
if: github.event_name == 'push' && env.BRANCH_NAME == 'main'
100107
uses: ncipollo/release-action@v1
101108
with:
102109
draft: true
@@ -109,6 +116,6 @@ jobs:
109116
name: ${{ env.RELEASE_TITLE }}
110117
bodyFile: "RELEASE.md"
111118

112-
- name: Upload online app installer to repository via FTP (master only)
113-
if: github.event_name == 'push' && env.BRANCH_NAME == 'master'
119+
- name: Upload online app installer to repository via FTP (main only)
120+
if: github.event_name == 'push' && env.BRANCH_NAME == 'main'
114121
run: python ${{ env.SCRIPTS_PATH }}/UploadToFtp.py ${{ env.BRANCH_NAME }} ${{ secrets.APP_REPO_FTP_PASSWORD }}

CHANGELOG.md

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

3+
### Changes 0.0.7
4+
5+
- No end-user related changes
6+
37
### Changes 0.0.6
48

59
- Enable plotting of reflectometry data with a logarithmic q-axes [6c26411](https://github.com/easyScience/EasyReflectometryApp/commit/6c26411c5a4d4f412ce475b16d64e0c46a040e55)

EasyReflectometryApp/Gui/Components/AnalysisFitables.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ EaComponents.TableView {
2525
//xml: ExGlobals.Constants.proxy.fitablesListAsXml
2626
xml: ExGlobals.Constants.proxy.parameter.parametersAsXml
2727

28-
query: "/root/item"
28+
query: "/data/item"
2929

3030
XmlRole { name: "id"; query: "id/string()" }
3131
XmlRole { name: "number"; query: "number/number()" }

EasyReflectometryApp/Gui/Components/ApplicationWindow.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ EaComponents.ApplicationWindow {
335335

336336
model: XmlListModel {
337337
xml: ExGlobals.Constants.proxy.state.statusModelAsXml
338-
query: "/root/item"
338+
query: "/data/item"
339339

340340
XmlRole { name: "label"; query: "label/string()" }
341341
XmlRole { name: "value"; query: "value/string()" }

EasyReflectometryApp/Gui/Pages/Project/MainContentDescription.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ Rectangle {
5252
text: ExGlobals.Constants.proxy.project.currentProjectPath
5353
}
5454

55-
EaElements.Label {
56-
text: ExGlobals.Constants.proxy.project.projectInfoAsJson.samples
55+
//EaElements.Label {
56+
// text: ExGlobals.Constants.proxy.project.projectInfoAsJson.samples
5757
//onEditingFinished: ExGlobals.Constants.proxy.editProjectInfo("samples", text)
58-
}
58+
//}
5959

6060
EaElements.Label {
6161
font.bold: true

EasyReflectometryApp/Gui/Pages/Sample/MultiLayerTable.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EaComponents.TableView {
1717
property int layersIndex: ExGlobals.Constants.proxy.model.currentLayersIndex + 1
1818

1919
xml: ExGlobals.Constants.proxy.model.layersAsXml
20-
query: `/root/item[${itemsTable.currentIndex + 1}]/layers/item`
20+
query: `/data/item[${itemsTable.currentIndex + 1}]/layers`
2121

2222
XmlRole { name: "thick"; query: "thickness/value/number()" }
2323
XmlRole { name: "rough"; query: "roughness/value/number()" }
@@ -59,7 +59,7 @@ EaComponents.TableView {
5959
horizontalAlignment: Text.AlignHCenter
6060
width: EaStyle.Sizes.fontPixelSize * 10.0
6161
headerText: "Thickness/Å"
62-
enabled: model.thick_enabled == "true"
62+
enabled: model.thick_enabled == "True"
6363
text: (isNaN(layersModel.thick)) ? '--' : layersModel.thick.toFixed(2)
6464
onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersThickness(text)
6565
}
@@ -69,7 +69,7 @@ EaComponents.TableView {
6969
horizontalAlignment: Text.AlignHCenter
7070
width: EaStyle.Sizes.fontPixelSize * 10.0
7171
headerText: "Upper Roughness/Å"
72-
enabled: model.rough_enabled == "true"
72+
enabled: model.rough_enabled == "True"
7373
text: (isNaN(layersModel.rough)) ? '--' : layersModel.rough.toFixed(2)
7474
onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersRoughness(text)
7575
}

EasyReflectometryApp/Gui/Pages/Sample/SideBarAdvanced.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ EaComponents.SideBarColumn {
123123
textRole: ExGlobals.Variables.iconifiedNames ? "iconified_label" : "label"
124124
model: XmlListModel {
125125
xml: ExGlobals.Constants.proxy.parameter.parametersAsXml
126-
query: "/root/item"
126+
query: "/data/item"
127127
XmlRole { name: "label"; query: "label/string()" }
128128
onXmlChanged: dependentParCurrentIndex = dependentPar.currentIndex
129129
}
@@ -160,7 +160,7 @@ EaComponents.SideBarColumn {
160160
textRole: ExGlobals.Variables.iconifiedNames ? "iconified_label" : "label"
161161
model: XmlListModel {
162162
xml: ExGlobals.Constants.proxy.parameter.parametersAsXml
163-
query: "/root/item"
163+
query: "/data/item"
164164
XmlRole { name: "label"; query: "label/string()" }
165165
// XmlRole { name: "iconified_label"; query: "iconified_label_with_index/string()" }
166166
onXmlChanged: independentParCurrentIndex = independentPar.currentIndex

EasyReflectometryApp/Gui/Pages/Sample/SideBarBasic.qml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ EaComponents.SideBarColumn {
3434
property int materialsIndex: ExGlobals.Constants.proxy.material.currentMaterialsIndex + 1
3535

3636
xml: ExGlobals.Constants.proxy.material.materialsAsXml
37-
query: "/root/item"
37+
query: "/data/item"
3838

3939
XmlRole { name: "color"; query: "color/string()" }
4040
XmlRole { name: "label"; query: "name/string()" }
@@ -176,7 +176,8 @@ EaComponents.SideBarColumn {
176176
// property int itemsIndex: ExGlobals.Constants.proxy.model.currentItemsIndex + 1
177177

178178
xml: ExGlobals.Constants.proxy.model.modelsAsXml
179-
query: "/root/item"
179+
// query: "/root/item"
180+
query: "/data/item"
180181

181182
XmlRole { name: "color"; query: "color/string()" }
182183
XmlRole { name: "label"; query: "name/string()" }
@@ -292,7 +293,7 @@ EaComponents.SideBarColumn {
292293
property int itemsIndex: ExGlobals.Constants.proxy.model.currentItemsIndex + 1
293294

294295
xml: ExGlobals.Constants.proxy.model.itemsAsXml
295-
query: "/root/item"
296+
query: "/data/item"
296297

297298
XmlRole { name: "label"; query: "name/string()" }
298299
XmlRole { name: "type"; query: "type/string()" }

EasyReflectometryApp/Gui/Pages/Sample/SurfactantTable.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ EaComponents.TableView {
6969
width: EaStyle.Sizes.fontPixelSize * 4.5
7070
headerText: "Solvation"
7171
enabled: model.solvation_enabled == "True"
72-
text: (isNaN(surfactantModel.solvation)) ? '--' : surfactantModel.solvation.toFixed(2)
72+
text: (isNaN(surfactantModel.solvation)) ? '--' : surfactantModel.solvation
7373
onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersSolvation(text)
7474
}
7575

@@ -79,7 +79,7 @@ EaComponents.TableView {
7979
width: EaStyle.Sizes.fontPixelSize * 4.0
8080
headerText: "APM/Å<sup>2</sup>"
8181
enabled: model.apm_enabled == "True"
82-
text: (isNaN(surfactantModel.apm)) ? '--' : surfactantModel.apm.toFixed(2)
82+
text: (isNaN(surfactantModel.apm)) ? '--' : surfactantModel.apm
8383
onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentItemApm(text)
8484
}
8585

EasyReflectometryApp/Logic/Proxies/Calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def currentCalculatorIndex(self, new_index: int):
3535
return
3636
new_name = self.calculatorNames[new_index]
3737

38-
model = self.parent._model_proxy.currentModelIndex
38+
model = self.parent._model_proxy._model[self.parent._model_proxy.currentModelIndex]
3939

4040
if self.parent._data_proxy.experimentLoaded:
4141
model = self.parent._data_proxy._data[self.parent._data_proxy.currentDataIndex].model

EasyReflectometryApp/Logic/Proxies/Fitter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
__author__ = 'github.com/arm61'
22

33
import sys
4-
from dicttoxml import dicttoxml
5-
from distutils.util import strtobool
64

75
from PySide2.QtCore import Signal, QThread, QObject, Property, Slot
86

@@ -185,6 +183,7 @@ def stop_fit(self):
185183
self._fitter_thread.stop()
186184

187185
def _onSampleChanged(self):
188-
self.sampleChanged.emit()
186+
print(">>> Sample changed")
187+
self.sampleChanged.emit() # this signal has no slots!
189188

190189

EasyReflectometryApp/Logic/Proxies/Material.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
__author__ = 'github.com/arm61'
22

3-
from dicttoxml import dicttoxml
4-
53
from matplotlib import cm, colors
64

75
from PySide2.QtCore import QObject, Signal, Property, Slot
86

97
from easyCore import borg
8+
from easyCore.Utils.io.xml import XMLSerializer
109

1110
from EasyReflectometry.sample.material import Material
1211
from EasyReflectometry.sample.materials import Materials
@@ -75,7 +74,8 @@ def _setMaterialsAsXml(self):
7574
"""
7675
Sets the _materials_as_xml object.
7776
"""
78-
self._materials_as_xml = dicttoxml(self.materialsAsObj).decode()
77+
print(">>> _setMaterialsAsXml")
78+
self._materials_as_xml = XMLSerializer().encode({"item":self.materialsAsObj}, data_only=True)
7979
self.materialsAsXmlChanged.emit()
8080

8181
@Property(list, notify=materialsChanged)

0 commit comments

Comments
 (0)