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

Update model editor #2918

Draft
wants to merge 43 commits into
base: release_6.0.0
Choose a base branch
from
Draft

Update model editor #2918

wants to merge 43 commits into from

Conversation

tsole0
Copy link
Contributor

@tsole0 tsole0 commented Jun 28, 2024

Description

  • Added GUI box for direct form volume function editing to PluginEditor.py (dd7819a, 98c0a31, 6dc2f84)
    • Auto-insert first polydisperse parameter into GUI box (b35ee1c)
    • Add tooltip and sample function to GUI box (3ea3929)
  • Changed text of GUI for clarity (3ea3929)
  • Updated Python model template
    • Add flags and explanatory text (b3bc16f, 5ccb501)
    • Adds Effective Radius and Volume Ratio functions to non-polydisperse model template (d28cba7)
  • Added capability to generate and save C models (bb37054, 84c7bdb, 2cc5296, 8bf8960, 3c26555, 8f7f7f2)
    • Added checkboxes to plugin editor giving user option to generate Python and/or C model templates (1251c38)
    • Created template for C models containing all kernel-defined functions and instructions for use (84c7bdb, f16633f, 5ccb501)
  • Linked Python and C files together by inserting source = ['filename.c'] into Python model template if both Python and C are generated (27ac6d6)
  • Run model checks on C code and report errors (NOT a C syntax check, but a MODEL check via sasmodels) (0c61d51, a1d04b3)
  • Added error popups for intuitive use:
    • Error if user does not specify model type (54b1159, bb61fb7)
    • Override dialog if user tries to save a model that contains errors asking if they would like to save or continue editing (20212f6, 7790233)
    • Info popup if user generates C model with no python model informing them that model checks will not be run (faefb31)
    • Warning popup if user loads a model with errors into model editor (a1d04b3)
  • Parameter tables in plugin widget GUI expand to fit available space (068cdb1)

Note: Merged #2917 into branch to fix tests
Note: Shares two commits with model-editor-bug-fixes branch (ba4cbc7, 26e6b59) because ba4cbc7 originated on this branch and 26e6b59 was necessary for error-checking C models

Linting:
de25165, 3ea3929

How Has This Been Tested?

TODO: windows installer, mac installer

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

TODO: Need minor documentation changes!!

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)

Licencing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

tsole0 added 30 commits June 18, 2024 14:38
The code changes in `PluginDefinition.py` add two new checkboxes for generating Python and C code in the UI. These checkboxes allow the user to specify whether they want to generate Python or C code when working with the plugin.
…ing C model template, connect so that it writes template to .c file and formats with user-input parameters
…re specified by separating pd-dependent funcs into C_PD_TEMPLATE and only including it if pd params exist
…lugin editor changes

bug fix: ensure that both a syntax check and a model check is run on model file before approving it; condense into checkModel method
…with C code. Clear highlights from both python and C windows if checks pass. Ensure that checkModel() is always passed a path argument instead of raw text.
… by removing os.remove(). allow user to load .c models into editor even if .c file fails model checks
… bad model check via QMessageBox prompt. This ensures no bad models are written to files without user agreement. Define full_path outside of python-specific code so that we can access it in C-specific code
… C model because no model checks can be run without a python wrapper. add showNoCompileWarning so user can override dialog after first showing
…Tab(). Initialize c_editor_widget in addWidgets(), only add editor widgets if needed, do not add widgets if one of same type already exists.
@tsole0 tsole0 changed the base branch from main to release_6.0.0 June 28, 2024 20:44
@tsole0 tsole0 added Enhancement Feature requests and/or general improvements FAIR Findability, Accessibility, Interoperability and Reuse Discuss At The Call Issues to be discussed at the fortnightly call and removed FAIR Findability, Accessibility, Interoperability and Reuse labels Jun 28, 2024
@tsole0 tsole0 removed the Discuss At The Call Issues to be discussed at the fortnightly call label Jul 15, 2024
@krzywon krzywon changed the base branch from release_6.0.0 to main October 25, 2024 14:54
@krzywon krzywon changed the base branch from main to release_6.0.0 October 25, 2024 14:55
@krzywon
Copy link
Contributor

krzywon commented Oct 25, 2024

This should be superseded by #3135. Keeping it open for now, but likely will be closed next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and/or general improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants