Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes in invariant prespective #2357

Merged
merged 3 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ def checkFakeDataState(self, widget):
assert not widget.txtNptsLowQ.isReadOnly()
assert not widget.txtNptsHighQ.isReadOnly()

assert widget.txtTotalQMin.isReadOnly()
assert widget.txtTotalQMax.isReadOnly()

# content of line edits
assert widget.txtName.text() == 'data'
assert widget.txtTotalQMin.text() == '0.009'
Expand Down
5 changes: 3 additions & 2 deletions src/sas/sascalc/invariant/invariant.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _get_data(self, data):
if new_data.dy is None or len(new_data.x) != len(new_data.dy) or \
(min(new_data.dy) == 0 and max(new_data.dy) == 0):
new_data.dy = np.ones(len(new_data.x))
return new_data
return new_data

def _fit(self, model, qmin=Q_MINIMUM, qmax=Q_MAXIMUM, power=None):
"""
Expand Down Expand Up @@ -914,7 +914,8 @@ def get_volume_fraction(self, contrast, extrapolation=None):
self.get_qstar(extrapolation)

if self._qstar <= 0:
msg = "Invalid invariant: Invariant Q* must be greater than zero"
msg = "Invalid invariant: Invariant Q* must be greater than zero\n"
msg += "Please check if scale and background values are correct"
raise RuntimeError(msg)

# Compute intermediate constant
Expand Down