Skip to content
New issue

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

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

Already on GitHub? # to your account

Various Multiplicity Model Fixes #2647

Merged
merged 36 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b3a21cc
Simplify some of the logic for handling multiplicity models
krzywon Sep 21, 2023
076bb8e
Fix issue related to copy parameters to file (latex/excel) for multip…
krzywon Sep 21, 2023
d2f87cb
Merge branch 'main' into 2369-multiplicity-copy
krzywon Sep 21, 2023
816c4cf
Fix error thrown when multiplicity param is sent to F(Q)P(Q) calculation
krzywon Sep 21, 2023
ea28ca8
Fix addition to poly model to ensure the polydispersity type combobox…
krzywon Sep 22, 2023
58414a0
Only display `Show SLD Profile` button for multiplicity models with s…
krzywon Sep 22, 2023
c6179b8
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Sep 27, 2023
62833e4
Missed replacement for variable removed from method call
krzywon Oct 2, 2023
de66a1b
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Oct 6, 2023
11af8ed
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Oct 26, 2023
a8c3b11
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Nov 6, 2023
6554380
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Dec 3, 2023
93a56e9
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Dec 15, 2023
96bec1a
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
Jan 15, 2024
16a3db6
Add suppressed model list and apply it to FittingWidget and AddMultEd…
krzywon Mar 1, 2024
039b6ef
Create a list of built-in layered models
krzywon Mar 4, 2024
61700ea
Use list of layered models to generate a shortened list of models tha…
krzywon Mar 4, 2024
733bc85
Code cleanup and string reuse
krzywon Mar 4, 2024
521ef95
Move list_models generation into updateModels
krzywon Mar 4, 2024
b9d3eab
Check all models if multiplicity models and add them to add/multi edi…
krzywon Mar 4, 2024
1a6c012
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
krzywon Mar 5, 2024
0ec0552
Get name of parameter rather than form volume parameter name to preve…
krzywon Mar 5, 2024
7c4c8f7
Update add multiply editor documentation to better match current func…
krzywon Mar 5, 2024
8057060
Do not update FittingWidget.n_shells_row in FittingWidget.updateFitte…
krzywon Mar 5, 2024
c046134
Merge release_6.0.0 into 2369-multiplicity-copy and fix merge conflic…
krzywon Mar 12, 2024
933b252
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
krzywon Apr 1, 2024
a05ed2d
Small fixes for PD functionality
krzywon Apr 5, 2024
ff16216
Remove all if not dict: return statements from FittingWidget
krzywon Apr 11, 2024
12c55d8
Copy params before modifying shell models to retain values after chan…
krzywon Apr 15, 2024
6a512a6
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
krzywon Apr 15, 2024
812a10b
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
butlerpd Apr 23, 2024
54b4076
Use regex to check param names for SLD profile button
krzywon Apr 29, 2024
d9bcb75
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
krzywon Apr 29, 2024
befe75e
Fix regex for multiplicity models related to SLD profile button
krzywon Apr 30, 2024
322ec8f
Merge branch 'release_6.0.0' into 2369-multiplicity-copy
butlerpd Apr 30, 2024
a5972fe
Fix SLD params regex - only catches layered params where final chara…
krzywon Apr 30, 2024
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
91 changes: 46 additions & 45 deletions src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,19 +882,23 @@ def formatParametersExcel(parameters: list):
check = ""
for parameter in parameters:
names += parameter[0]+tab
# Add the error column if fitted
if parameter[1] == "True" and parameter[3] is not None:
names += parameter[0]+"_err"+tab

values += parameter[2]+tab
check += parameter[1]+tab
if parameter[1] == "True" and parameter[3] is not None:
values += parameter[3]+tab
# add .npts and .nsigmas when necessary
if parameter[0][-6:] == ".width":
names += parameter[0].replace('.width', '.nsigmas') + tab
names += parameter[0].replace('.width', '.npts') + tab
values += parameter[5] + tab + parameter[4] + tab
if len(parameter) > 3:
# Add the error column if fitted
if parameter[1] == "True" and parameter[3] is not None:
names += parameter[0]+"_err"+tab

values += parameter[2]+tab
check += str(parameter[1])+tab
if parameter[1] == "True" and parameter[3] is not None:
values += parameter[3]+tab
# add .npts and .nsigmas when necessary
if parameter[0][-6:] == ".width":
names += parameter[0].replace('.width', '.nsigmas') + tab
names += parameter[0].replace('.width', '.npts') + tab
values += parameter[5] + tab + parameter[4] + tab
else:
# Empty statement for debugging purposes
pass

output_string = names + crlf + values + crlf + check
return output_string
Expand All @@ -913,46 +917,43 @@ def formatParametersLatex(parameters: list):
output_string += r'}\hline'
output_string += crlf

names = ""
values = ""

for index, parameter in enumerate(parameters):
name = parameter[0] # Parameter name
output_string += name.replace('_', r'\_') # Escape underscores
# Add the error column if fitted
if parameter[1] == "True" and parameter[3] is not None:
output_string += ' & '
output_string += parameter[0]+r'\_err'

if index < len(parameters) - 1:
output_string += ' & '

# add .npts and .nsigmas when necessary
if parameter[0][-6:] == ".width":
output_string += parameter[0].replace('.width', '.nsigmas') + ' & '
output_string += parameter[0].replace('.width', '.npts')
names += name.replace('_', r'\_') # Escape underscores
if len(parameter) > 3:
values += f" {parameter[2]}"
# Add the error column if fitted
if parameter[1] == "True" and parameter[3] is not None:
names += f" & {parameter[0]} " + r'\_err'
values += f' & {parameter[3]}'

if index < len(parameters) - 1:
output_string += ' & '
names += ' & '
values += ' & '

# add .npts and .nsigmas when necessary
if parameter[0][-6:] == ".width":
names += parameter[0].replace('.width', '.nsigmas') + ' & '
names += parameter[0].replace('.width', '.npts')
values += parameter[5] + ' & '
values += parameter[4]

if index < len(parameters) - 1:
names += ' & '
values += ' & '
elif len(parameter) > 2:
values += f' & {parameter[2]} &'
else:
values += f' & {parameter[1]} &'

output_string += names
output_string += r'\\ \hline'
output_string += crlf

# Construct row of values and errors
for index, parameter in enumerate(parameters):
output_string += parameter[2]
if parameter[1] == "True" and parameter[3] is not None:
output_string += ' & '
output_string += parameter[3]

if index < len(parameters) - 1:
output_string += ' & '

# add .npts and .nsigmas when necessary
if parameter[0][-6:] == ".width":
output_string += parameter[5] + ' & '
output_string += parameter[4]

if index < len(parameters) - 1:
output_string += ' & '

output_string += values
output_string += r'\\ \hline'
output_string += crlf
output_string += r'\end{tabular}'
Expand Down
Loading
Loading