Bax visualization extension - #275
Conversation
…lop-bax-extension
|
@dylanmkennedy Test the extension with the updated Xopt and bax-algorithm PR changes referenced to confirm desired function |
…ents are referenced in the other extensions
…nd new BAX algorithm implementation
…ated pre-commit hook
…tly more default rules which would inflate PR
|
The main Badger GUI selects index 0 of the generator list as the 'default', which in this case becomes Badger/src/badger/gui/pages/home_page.py Line 306 in 29b875e Didn't make it a separate method (and ui element names are slightly different) but something like this seems to work well 9dc4e30 |
I've made the change to have it default to "neldermead" instead of "bax" as the default. The generators were originally sorted alphabetically causing the change. |
|
Testing on mac the temp folder shows up where I'd expect, and badger settings dialog menu looks good. This may be minor/separate, but might be helpful to have documentation/comments somewhere outside of the PR description on how badger uses temp files, it's not obvious that the |
|
Added description of new temp directory to docs. Requested @dylanmkennedy to put together a generator guide for the bax generator for the docs |
|
FYI the changes to the CI/packaging look good to me. |
|
One thing to note is that I don't think |
nstelter-slac
left a comment
There was a problem hiding this comment.
nice!
here are some of my initial thoughts on this PR:
-
maybe i have things setup wrong but after pulling this PR, when i click from a different algo then to bax on the "Algorithms" tab, i get an error popup from "get_compatible_algorithms()". can u describe how u manually tested this in the commit msg?
-
and tests for the new gui code functionality would be really nice
-
this PR is too big for my tastes, and including style/formatting changes in the PR makes harder to see the actual functional changes. especially with ai making large changes now, i think we should make extra sure to keep PRs small and manageable for review
-
will bax documentation be added when click "Open Docs" button for bax?
-
and should the "gui guide" (https://github.com/xopt-org/Badger/blob/main/GUI_GUIDE.md) be updated with screenshots of the new gui windows?
-
minor thing: this PR comes from a branch on slaclab:badger instead of a fork. should we standardize on using PRs from forks since badger is community wide open-source project? (and since only those with permissions can make branches).
Both
There are no gui tests currently for any of the badger extensions. I can aim to add gui tests to
Yes, I agree that the PR has inflated in size over the last 2-3 months of work. I will aim to keep future PRs to a more manageable size.
I have requested @dylanmkennedy to put together documentation which will provide the info once the button is pressed.
I can add a guide for the
As a maintainer of the project I don't see any issues with where a PR comes from, as both are welcome. If you feel strongly we can have these meta discussions with the rest of the group. |
PR #275 — Changelog
Added new BAX visualization extension which displays plots related to BAX algorithm runs
extensions_palette.py,BaxVisualizerclass inanalysis_extensions.py)GridOptimize,EmittanceAlgorithm, andPathwiseSolenoidAlignment— plot options and result keys differ per algorithm, and unused options are hiddensrc/badger/gui/components/bax_visualizer/(bax_widget.py,controls.py,plotting.py,ui.py)baxgenerator un-excluded fromALGO_EXCLUDEDinfactory.pyso it's selectable in the UIAdded reference-point support to BAX and BO extensions
get_latest_reference_points()helper inextension_utilities.pyBADGER_TEMP_DIRECTORYadditionsBADGER_TEMP_DIRECTORYsetting, used by the BAX generator to store filestemp(e.g.~/Library/Application Support/Badger/temp)baxalgorithm is used, creates a new temp folder insideBADGER_TEMP_DIRECTORYmatching the archive file nameget_or_create_temp_directory()insettings.py: migrates older/relative configs to an absolute path under the user config folder, ensures it exists, and falls back to the config folder on permission errorsbuild_bax_results_file()helper ingui/utils.pyandfilter_generator_configBAX branch that setalgorithm_results_file; used fromhome_page.pyto create the per-run folderbadger infoCLI now reports the temporary directory (actions/__init__.py)BADGER_LOG_DIRECTORY(previously never saved) alongside the new temp directory (settings_dialog.py)mock_settingsand test fixturesPydantic editor changes
bax-algorithmsthat live outside XoptBaxGenerator._supported_algorithmspd.DataFrame)COMMON_EXCLUDED_FIELDS/GENERATOR_EXCLUDED_FIELDSframework viaget_excluded_fields(); excludescomputation_timeandalgorithm_results_fileclass_pathcomputed field so vendored BAX algorithms appear in the editorBO Visualizer & Pareto Front fixes
AnalysisExtensionbase changed fromQDialogto a top-levelQWidget(Window flag) for consistent lifetime/stackingAnalysisWidgetreworked: addedreset_widget()and rebuiltrequires_reinitialization()run/data-growth trackingpf_viewer/pf_widget.py,pf_viewer/types.py)Packaging /
pyproject.tomlbax-algorithmsas a dependency for the required external BAX algorithmsxoptto>=3.2.1--cov=badgerinstead of--cov=badger/) so coverage data is collected[options]table with[tool.setuptools]license = "GPL-3.0-or-later"+license-files), removed the deprecated license classifier, and bumpedsetuptools>=77.0.0CI / tooling
.pre-commit-config.yaml:pre-commit-hooksv5→v6,ruffv0.12.2→v0.15.16 added a commented-out mypy hookdocs.yml,lint.yml,pypi_release.yml,tests.yml:checkoutv4→v7,setup-nodev4→v7,setup-pythonv5→v7,setup-minicondav3→v4AGENTS.mdcoverage noteTests
conftest.py: addedmock_temp_directoryfixture and temp-dir setup/teardowntest_factory.py: added abaxgenerator instantiation casetest_cli_basic.py: expectedbadger infoline count 11→12test_gui_basic.py: hardened the low-noise-prior assertion for generators that hide the keytest_settings.py: patchesget_or_create_temp_directoryin the init-settings testMisc
run_monitor.py,routine_page.py,utils.py, and others)