Skip to content

Commit

Permalink
Adds DOI and updates version to 1.1.0, adds bugfix and updates docs
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenNneji committed Sep 3, 2021
1 parent f1d5eb1 commit ab80efd
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![release](https://img.shields.io/github/release/ISISNeutronMuon/SScanSS-2.svg)](https://github.com/ISISNeutronMuon/SScanSS-2/releases)
[![Actions Status](https://github.com/ISISNeutronMuon/SScanSS-2/workflows/Build/badge.svg)](https://github.com/ISISNeutronMuon/SScanSS-2/actions)
[![Actions Status](https://github.com/ISISNeutronMuon/SScanSS-2/workflows/Docs/badge.svg)](https://github.com/ISISNeutronMuon/SScanSS-2/actions)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4476755.svg)](https://doi.org/10.5281/zenodo.4476755)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5266561.svg)](https://doi.org/10.5281/zenodo.5266561)

SScanSS 2
=========
Expand Down Expand Up @@ -76,5 +76,5 @@ Citing SScanSS 2
1. J. A. James, J. R. Santisteban, L. Edwards and M. R. Daymond, “A virtual laboratory for neutron and synchrotron
strain scanning,” Physica B: Condensed Matter, vol. 350, no. 1-3, p. 743–746, 2004.

2. Nneji Stephen. (2021). SScanSS 2—a redesigned strain scanning simulation software (Version 1.0.0).
[http://doi.org/10.5281/zenodo.4476755](http://doi.org/10.5281/zenodo.4476755).
2. Nneji Stephen. (2021). SScanSS 2—a redesigned strain scanning simulation software (Version 1.1.0).
[http://doi.org/10.5281/zenodo.5266561](http://doi.org/10.5281/zenodo.5266561).
6 changes: 4 additions & 2 deletions build_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def build_editor():
'--windowed', '--noconfirm', '--distpath', dist_path, '--clean', main_path]

pyi_args.extend(['--exclude-module', 'coverage', '--exclude-module', 'jedi', '--exclude-module', 'tkinter',
'--exclude-module', 'IPython', '--exclude-module', 'lib2to3', '--exclude-module', 'scipy',
'--exclude-module', 'IPython', '--exclude-module', 'lib2to3',
'--exclude-module', 'PyQt5.QtDBus', '--exclude-module', 'PyQt5.QtDesigner',
'--exclude-module', 'matplotlib', '--exclude-module', 'hdf5',
'--exclude-module', 'PyQt5.QtBluetooth', '--exclude-module', 'PyQt5.QtNetwork',
Expand All @@ -71,6 +71,7 @@ def build_editor():
'--exclude-module', 'PyQt5.QtSql', '--exclude-module', 'PyQt5.QtSvg',
'--exclude-module', 'PyQt5.QtSerialPort', '--exclude-module', 'PyQt5.QtNetwork',
'--exclude-module', 'PyQt5.QtScript', '--exclude-module', 'PyQt5.QtXmlPatterns',
'--hidden-import', 'scipy.spatial', '--hidden-import', 'scipy.optimize',
'--hidden-import', 'pkg_resources.py2_warn', '--hidden-import', 'PyQt5.QtPrintSupport',
'--hidden-import', 'PyQt5.QtOpenGL'])

Expand Down Expand Up @@ -109,7 +110,8 @@ def build_sscanss():
'--exclude-module', 'PyQt5.QtNetwork', '--exclude-module', 'PyQt5.QtPrintSupport',
'--exclude-module', 'PyQt5.QtScript', '--exclude-module', 'PyQt5.QtXmlPatterns',
'--hidden-import', 'scipy.spatial', '--hidden-import', 'scipy.optimize',
'--hidden-import', 'pkg_resources.py2_warn', '--hidden-import', 'PyQt5.QtOpenGL'])
'--hidden-import', 'pkg_resources.py2_warn', '--hidden-import', 'PyQt5.QtOpenGL',
'--exclude-module', 'PyQt5.QtWinExtras'])

if is_win:
pyi_args.extend(['--icon', os.path.join(INSTALLER_PATH, 'icons', 'logo.ico')])
Expand Down
20 changes: 8 additions & 12 deletions docs/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Example Usage
=============
This tutorial illustrates the basic ideas behind the SScanSS 2 software. The files used in this tutorial can be
downloaded from the SScanSS 2 |release| page on github. Download and extract **data.zip** from the release's **assets**.
This tutorial uses the ENGIN-X instrument but the techniques shown should apply to other instruments.
found in the *examples/simple* folder in the install directory. This tutorial uses the ENGIN-X instrument and the steps
shown should apply to other instruments.

We begin by creating a new project, click **File**, and then click **New Project**. You will see the new project dialog.
Type in a project name, select ENGIN-X as the instrument and the click create.
Expand Down Expand Up @@ -42,8 +42,8 @@ You will see the sample model in the graphics window.
:align: center

3. Click **Insert > Measurement Vectors > Select Strain Component** the select stain component "Parallel to X Axis".
Click **Add Measurement Vectors** and in the graphics window, you will see the blue line segments drawn from the measurement point along the
X Axis.
Click **Add Measurement Vectors** and in the graphics window, you will see the blue line segments drawn from the
measurement point along the X Axis.

.. image:: images/insert_vector.png
:scale: 50
Expand Down Expand Up @@ -72,17 +72,13 @@ sample model, fiducials, measurement points and vector
:align: center

3. Start a new simulation by clicking **Simulation > Run Simulation** or the **F5** key. You will see the instrument
move the sample into the appropriate position and orientation for each measurement and the result displayed in a
dialog
move the sample into the appropriate position and orientation for each measurement and the results displayed in
simulation window

.. image:: images/run_sim.png
:scale: 50
:alt: Run Simulation
:align: center

4. Finally the result script can be exported by clicking **File > Export > Script** and then click **Export** on the
dialog.

.. |release| raw:: html

<a href="https://github.com/ISISNeutronMuon/SScanSS-2/releases/" target="_blank">release</a>
4. The script to perform the measurement on the real world instrument (if the sample was mount exactly the same) can be
exported by clicking **File > Export > Script** and then click **Export** on the script dialog.
Binary file modified docs/images/editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions examples/simple/simple_single_detector.vecs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1.0000000 0.0000000 0.0000000
1.0000000 0.0000000 0.0000000
1.0000000 0.0000000 0.0000000
1.0000000 0.0000000 0.0000000
-0.0000000 -0.0000000 -1.0000000
-0.0000000 -0.0000000 -1.0000000
-0.0000000 -0.0000000 -1.0000000
-0.0000000 -0.0000000 -1.0000000
File renamed without changes.
4 changes: 2 additions & 2 deletions sscanss/__version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.0.1'
__editor_version__ = '1.0.0'
__version__ = '1.1.0'
__editor_version__ = '1.1.0'
6 changes: 3 additions & 3 deletions sscanss/app/dialogs/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __init__(self, parent):
'<ol><li>J. A. James, J. R. Santisteban, L. Edwards and M. R. Daymond, “A virtual laboratory for '
'neutron and synchrotron strain scanning,” Physica B: Condensed Matter, vol. 350, no. 1-3, '
'p. 743–746, 2004.</li>'
'<li>Nneji Stephen. (2021). SScanSS 2—a redesigned strain scanning simulation software (Version 1.0.0).'
' <a href="http://doi.org/10.5281/zenodo.4476755">http://doi.org/10.5281/zenodo.4476755</a>.</li>'
'<li>Nneji Stephen. (2021). SScanSS 2—a redesigned strain scanning simulation software (Version 1.1.0).'
' <a href="http://doi.org/10.5281/zenodo.5266561">http://doi.org/10.5281/zenodo.5266561</a>.</li>'
'</ol>'
'<h3>Credit</h3>'
'<ul><li>Icons from FontAwesome</li></ul>'
Expand Down Expand Up @@ -95,7 +95,7 @@ def __init__(self, recent, parent):
self.setLayout(self.main_layout)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
self.setMinimumSize(640, 480)
self.setMinimumSize(640, 500)
self.main_layout.setContentsMargins(1, 1, 1, 1)

self.createImageHeader()
Expand Down
3 changes: 2 additions & 1 deletion sscanss/editor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sscanss.core.instrument import read_instrument_description, Sequence
from sscanss.core.io import read_kinematic_calibration_file
from sscanss.core.scene import OpenGLRenderer, SceneManager
from sscanss.core.util import Directions
from sscanss.core.util import Directions, Attributes
from sscanss.editor.dialogs import CalibrationWidget, Controls
from sscanss.editor.editor import Editor

Expand Down Expand Up @@ -75,6 +75,7 @@ def __init__(self):
self.gl_widget = OpenGLRenderer(self)
self.gl_widget.custom_error_handler = self.sceneSizeErrorHandler
self.scene = SceneManager(self, self.gl_widget, False)
self.scene.changeVisibility(Attributes.Beam, True)
self.animate_instrument.connect(self.scene.animateInstrument)

self.editor = Editor(self)
Expand Down
6 changes: 3 additions & 3 deletions sscanss/editor/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def changeCollimator(self):
index = self.combobox.currentIndex()
collimator = None if index == 0 else self.combobox.currentText()
self.detector.current_collimator = collimator
self.parent.manager.updateInstrumentScene()
self.parent.scene.updateInstrumentScene()
self.collimator_changed.emit(self.name, self.combobox.currentText())

def createPositionerForm(self):
Expand Down Expand Up @@ -304,7 +304,7 @@ def moveJawsButtonClicked(self):

def changeApertureButtonClicked(self):
self.instrument.jaws.aperture = [self.aperture_forms[0].value(), self.aperture_forms[1].value()]
self.parent.manager.updateInstrumentScene()
self.parent.scene.updateInstrumentScene()


class PositionerWidget(QtWidgets.QWidget):
Expand Down Expand Up @@ -359,7 +359,7 @@ def changeStack(self, selected):
if selected != self.instrument.positioning_stack.name:
self.parent.instrument.loadPositioningStack(selected)
self.createForms()
self.parent.manager.updateInstrumentScene()
self.parent.scene.updateInstrumentScene()

def createForms(self):
"""Creates form inputs for main and auxiliary positioners in the positioning stack"""
Expand Down
6 changes: 2 additions & 4 deletions tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from PyQt5.QtWidgets import QApplication, QLineEdit, QComboBox, QDoubleSpinBox
from sscanss.core.instrument.instrument import Instrument, PositioningStack, Detector, Script, Jaws
from sscanss.core.instrument.robotics import Link, SerialManipulator
from sscanss.core.scene import SceneManager
from sscanss.editor.main import Window
from sscanss.editor.widgets import PositionerWidget, JawsWidget, ScriptWidget, DetectorWidget
from sscanss.editor.dialogs import CalibrationWidget, Controls
Expand All @@ -18,7 +17,8 @@
class TestEditor(unittest.TestCase):
app = QApplication([])

def setUp(self):
@mock.patch('sscanss.editor.main.SceneManager', autospec=True)
def setUp(self, scene_mock):
self.view = Window()
self.view.animate_instrument = TestSignal()
self.view.filename = ''
Expand All @@ -38,8 +38,6 @@ def setUp(self):
self.view.instrument.detectors = {'East': Detector('East', [1, 0, 0])}
self.view.instrument.script = Script('{{header}}\n{{#script}}\n{{position}} {{mu_amps}}\n{{/script}}')

self.view.manager = mock.create_autospec(SceneManager)

def testPositionerWidget(self):
widget = PositionerWidget(self.view)
widget.changeStack('b')
Expand Down

0 comments on commit ab80efd

Please sign in to comment.