Skip to content

Commit

Permalink
Merge branch 'main' into 2604-allow-multiple-slicers-of-the-same-slic…
Browse files Browse the repository at this point in the history
…er-type
  • Loading branch information
krzywon authored Sep 18, 2023
2 parents 70ba195 + aca82c5 commit 7254834
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- uses: actions/checkout@v3
- id: set-matrix
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
- name: Install utilities to build installer
if: ${{ matrix.installer }}
run: |
python -m pip install pyinstaller==5.7.0
python -m pip install pyinstaller
- name: Build sasview with pyinstaller
if: ${{ matrix.installer }}
Expand Down Expand Up @@ -283,7 +283,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-20.04 ]
python-version: [ 3.8 ]
python-version: [ 3.11 ]
fail-fast: false

name: Test installer
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@

# List of python versions to use for release builds
python_release_list = [
'3.8',
'3.11',
]

# List of python versions to use for tests
python_test_list = python_release_list + [
'3.8',
'3.9',
'3.10'
]
Expand Down
8 changes: 4 additions & 4 deletions build_tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy<1.24
scipy==1.10.0
numpy
scipy
docutils
pytest
pytest_qt
Expand All @@ -21,7 +21,7 @@ xhtml2pdf
pylint
periodictable
uncertainties
matplotlib~=3.5.2
matplotlib
lxml
pytools
cffi
Expand All @@ -32,7 +32,7 @@ bumps
html2text
jsonschema
pywin32; platform_system == "Windows"
PySide6==6.2.4
PySide6==6.4.3
twisted
zope
superqt
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx-docs/source/dev/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Contents
SasView API <sasview-api/modules>
sasmodels overview <sasmodels-dev/index>
sasmodels API <sasmodels-api/modules>
OpenGL subsystem <gl/opengl.rst>

Indices and Search
------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx-docs/source/dev/gl/opengl.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Open GL Subsystem
==============
=================

The SasView openGL subsystem is quite minimal, and works in the standard way though a scenegraph

Expand All @@ -8,6 +8,6 @@ a way of checking the rendering, and catalogue the available functions


Class Hierarchy
===============
^^^^^^^^^^^^^^^

TODO - data currently in PR.
4 changes: 4 additions & 0 deletions src/sas/qtgui/Perspectives/Fitting/media/fitting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ Fitting Documentation
Information on the SasView Optimisers <optimizer>

Conversion of SANS to SESANS for Fitting <sesans/sans_to_sesans>

Fitting SESANS using the Old GUI <sesans/sesans_fitting.rst>

Writing a Plugin Model <plugin>

Scripting interface to Sasmodels <scripting>

Computations with a GPU <gpu_setup>

References <refs>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def step(x: np.ndarray):


def rect(x: np.ndarray):
""" Rectangle function, zero if |input| > 1, 1 otherwise"""
""" Rectangle function, zero if mod(input) > 1, 1 otherwise"""
out = np.zeros_like(x)
out[np.abs(x) <= 1] = 1.0
return out
Expand Down
50 changes: 24 additions & 26 deletions src/sas/qtgui/Perspectives/ParticleEditor/sampling/chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@
Something like this
First Point
1 2 3 | 4 5 6 | 7 8 9 | 0
1 | | |
S | | |
e 2 CHUNK 1 | CHUNK 2 | CHUNK 3 | CHUNK 4
c | | |
o 3 | | |
n ---------------+-----------+-----------+------------
d 4 | | |
| | |
P 5 CHUNK 5 | CHUNK 6 | CHUNK 7 | CHUNK 8
o | | |
i 6 | | |
n ---------------+-----------+-----------+------------
t 7 | | |
| | |
8 CHUNK 9 | CHUNK 10 | CHUNK 11 | CHUNK 12
| | |
9 | | |
---------------+-----------+-----------+------------
0 | | |
CHUNK 13 | CHUNK 14 | CHUNK 15 | CHUNK 16
| | |
. First Point
. 1 2 3 | 4 5 6 | 7 8 9 | 0
. 1 | | |
.S | | |
.e 2 CHUNK 1 | CHUNK 2 | CHUNK 3 | CHUNK 4
.c | | |
.o 3 | | |
.n ---------------+-----------+-----------+------------
.d 4 | | |
. | | |
.P 5 CHUNK 5 | CHUNK 6 | CHUNK 7 | CHUNK 8
.o | | |
.i 6 | | |
.n ---------------+-----------+-----------+------------
.t 7 | | |
. | | |
. 8 CHUNK 9 | CHUNK 10 | CHUNK 11 | CHUNK 12
. | | |
. 9 | | |
. ---------------+-----------+-----------+------------
. 0 | | |
. CHUNK 13 | CHUNK 14 | CHUNK 15 | CHUNK 16
. | | |
"""


Expand Down
4 changes: 2 additions & 2 deletions src/sas/qtgui/Plotting/Slicers/BoxSlicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class BoxInteractorX(BoxInteractor):
"""
Average in Qx direction. The data for all Qy at a constant Qx are
averaged together to provide a 1D array in Qx (to be plotted as a function
of Qx)
of Qx)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
Expand Down Expand Up @@ -528,7 +528,7 @@ class BoxInteractorY(BoxInteractor):
"""
Average in Qy direction. The data for all Qx at a constant Qy are
averaged together to provide a 1D array in Qy (to be plotted as a function
of Qy)
of Qy)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
Expand Down
19 changes: 11 additions & 8 deletions src/sas/qtgui/Plotting/Slicers/WedgeSlicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ def _post_data(self, new_sector=None, nbins=None):
:param new_sector: slicer used for directional averaging in Q or Phi
:param nbins: the number of point plotted when averaging
:TODO - Unlike other slicers, the two sector types are sufficiently
different that this method contains three instances of If (check class name) do x.
The point of post_data vs _post_data I think was to avoid this kind of thing and
suggests that in this case we may need a new method in the WedgeInteracgtorPhi
and WedgeInteracgtorQ to handle these specifics. Probably by creating the 1D plot
object in those top level classes along with the specifc attributes.
:TODO
Unlike other slicers, the two sector types are sufficiently different
that this method contains three instances of If (check class name) do x.
The point of post_data vs _post_data I think was to avoid this kind of
thing and suggests that in this case we may need a new method in the WedgeInteracgtorPhi and WedgeInteractorQ to handle these specifics.
Probably by creating the 1D plot object in those top level classes along
with the specifc attributes.
"""
# Data to average
data = self.data
Expand Down Expand Up @@ -333,7 +336,7 @@ class WedgeInteractorQ(WedgeInteractor):
"""
Average in Q direction. The data for all phi at a constant Q are
averaged together to provide a 1D array in Q (to be plotted as a function
of Q)
of Q)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
Expand All @@ -350,7 +353,7 @@ class WedgeInteractorPhi(WedgeInteractor):
"""
Average in phi direction. The data for all Q at a constant phi are
averaged together to provide a 1D array in phi (to be plotted as a function
of phi)
of phi)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Utilities/GuiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ def jdefault(o):
objects that can't otherwise be serialized need to be converted
"""
# tuples and sets (TODO: default JSONEncoder converts tuples to lists, create custom Encoder that preserves tuples)
if isinstance(o, (tuple, set, np.float)):
if isinstance(o, (tuple, set, float)):
content = { 'data': list(o) }
return add_type(content, type(o))

Expand Down
6 changes: 3 additions & 3 deletions src/sas/sascalc/pr/p_invertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

class Pinvertor(object):
#q data
x = np.empty(0, dtype=np.float)
x = np.empty(0, dtype=np.float64)
#I(q) data
y = np.empty(0, dtype=np.float)
y = np.empty(0, dtype=np.float64)
#dI(q) data
err = np.empty(0, dtype=np.float)
err = np.empty(0, dtype=np.float64)
#Number of q points
npoints = 0
#Number of I(q) points
Expand Down
3 changes: 2 additions & 1 deletion src/sas/sascalc/realspace/VolumeCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ def getParam(self, name):

def getParamList(self, shapeid=None):
"""
return a full list of all available parameters from
.... return a full list of all available parameters from
self.params.keys(). If a key in self.params is a instance
of ShapeDescriptor, extend the return list to:
[param1,param2,shapeid.param1,shapeid.param2.......]
If shapeid is provided, return the list of parameters that
Expand Down

0 comments on commit 7254834

Please sign in to comment.