Skip to content

Commit 7212879

Browse files
KedoKudopre-commit-ci[bot]along4alexmlongLANLCopilot
authored
Advance v2.0 to main (conflicts resolved) (#149)
* add document to docs for original design * fix name typo * add refactor design document * switch to pep621 format * add boardening card parser * add boradening paramter card * add unused card * add normalization card * add radius parser * add unit test for radii * finished up development for radii card * add parser for data reduction * add unit test for data reduction * add draft orres card * update orres and imp partial unit test * add unit test for LITHI * add unit test for NE110 * add unit test for ChannelParameters * add final integrate test for orres card * expore orrse card at top level * add isotope and unit test * add delta and eta * add finit and gamma card * add Tzero * add siabn * add SELFI * add EFFIC * add DELTE * add DrcapParameters * add NONUN * remove special character * add paramagnetic card * enable checks from v2.0 * add place holder modules for card not used now * enable pre-commit * adjust exclude pattern * safe guard not implemented cards * safe guard resolution card with not implemented errors * safe guard det efficiency card with not implemented error * start with Burst param * add CHANN param * deal with edge cases * update top level import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add placeholder for the last card * add to_string method for top level * add from string and aux func to top param class * fix unit basic unit tests * fix broadening card str format issue * fixing logic errors in parsing cards * radius card has serious issue, need special attention, disable for now * Fix radius card bug * remove debug print and add usage example notebook * adding ex012 example in notebook format. * fixed bug with reading in isotope header for card 10 in the parfile * added some print statements for errors from_string that prints the actual line you are reading * cut out print statements I added into wrong error message. * added repo map (not complete) * adding notebooks. * deleted notebook * made fudge card optional * updated repo.map * got rid off le=1.0 for abundances in Isotope class. * modified isotope.py to not use extended format and git rid of validate_abundance. * added a fudge factor line * modified print_parameters function. * modified notebook ex012a.ipynb * modified notebook * adding logger for debugging issues * adding os and logger imports to parfile.py * moved _log_and_raise_error() to logger.py * implemented logging in parfile.py for most functions. * adding more logging functionality. * added class and function finder. * reorged radius.py * got rid of logger functionality to find class and function being called * got rid of get_current_class_and_function() * using where_am_i strings for debugging * idk! * debugging default card reading * fixed bug to allow RadiusCard to handle multiple RadiusParameters entries * deleted example. * added attribustes in doc string of ResonanceEntry * finally fixed bugs in radius with printing to file! * expanded print function for parameters * added notes on parameter libraries. * updated debug to info for logging * added loggign * got rid of RadiusParametersContainer class. * adding more detials to parfile_notes.md * updated notebook for example 12. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * got rid of testing abundance validation, since this is no longer true. Deleted extended isotope format since this is unsupported. * Fixed bug in IsotopeCard.is_header_line(). Can now identify both "ISOTO" and "NUCLI" * adjusted functions test_radius.py for new list object for RadiusCard. * adjusted test_full_roundtrip to handle list of radiusParameters * fixed bug in reading in parFile strings. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * using unused variables in RadiusCardKeyword class to make overlord "pre-commit.ci" happy * more making overlord happy * moved helper.py to core/ * adding nuclear params as base class * added additional validator for spin groups in RadiusParameters * moved helper to core, so I needed to change import paths. * I think I broke isotope.py... for now. * Starting to add to physics params * moved helper.py to utils/ * added EnergyParameters, NormalizationParameters, and UserResolutionParameters * updated helper import since moving. * moved fit_params.py to src/pleiades/sammy * added isotope name to IsotopeParameters and created nuclearParameters to have as a list of isotopes. * created PhysicsParameters * made class of AlphanumericOptions. To be used for determining steps in sammy fits. * moved notes to alphanumerics folder. * created class to determine how to treat spin group information and other parameters in SAMMY. Naming based on tables VI A1.1. Also created unit tests. * Adding more detials to notes. * created class pcm_out.py to define the method of output for the parameter covariance matrix, along with unit tests. naming based on Table VI A1.1 in SAMMY manual * create class pcm_in.py to define the prior parameter covariance matrix, along with unit tests. Naming based on Table VI A1.1 in SAMMY manual. * Added class to define which approximation to the R-matrix is to be used for this calculation. Naming based on Table VI A1.1. * fixed bug in rm.py to allow for setting non-default options to true and being mutually_exclusive. Setting default to false. * deleting more options from AlphanumericOptions class as I migrate them. * Added broad.py to determine if broadening is wanted in the sammy fit. * added data class to define the format for the experimental data * updated notes on alphanumeric commands * updated fit_params.py with alphanumerics import * updating alphanumeric notes * added multiple scattering class to define how the multiple scattering corrections are to proceed * updating notes on alphanumeric commands * finally got logic to enforce exclusivity. Starting with data. * updated broad.py with new exclusivity logic. * updated alphanumeric notes * updated dcm.py and unit tests with new mutually exclusive logic. * updated msc and unit test. * updated params and unit tests with new logic for mutually exclusive groups * small edits for readability * updated pcm_in class * updated pcm_out and its unit tests. * updated rm * making coding style in classes and tests more consistent. * fixing casing issue with tests. * cleaning up code * code clean up! * final code clean up * adding lpt option class * created unit tests for lpt option class. * created bayes option class and unit tests. * updated alphanumeric notes * deleteted, since it was refactored. * adding general fit option class. * added some comments * trying to figure out how to implement general fit options into the fit parameters file. * making fit options tests * updating fit_options and unit tests * took out dataTypeOptions * adding comments and example usage. * adding data option file * updated data options. * me make code pretty * moved dataType option to option.py in data dir * adding pint capabilities to data/options.py * reorging fit_params.py * adding a unit class in pleiades utils. * got rid of converting unit functions. * add unit tests for dataParameters in test_options.py * refactor unit options and add unit tests for energy and cross-section conversions * add fit options model and enumerations for SAMMY configuration * add FitConfig and FitOptions models for SAMMY configuration * remove obsolete FitOptions and physics parameters tests * renamed nuclear and experimental libraries * update import paths for nuclear and experimental parameters in fitting config * update import statement for IsotopeParameters to reflect new module structure * add unit tests for FitOptions and FitConfig classes * renamed data to nuclear * more renaming of data to nuclear * renaming to parameters in nuclear dir * renaming to manager in nuclear dir * refactor import path for nuclearParameters in config.py * refactor import path for IsotopeParameters in isotope.py * refactor import paths for NuclearDataManager and nuclearParameters * moved models to nuclear directory * refactor import path for Isotope in transmission.py * refactor import paths for NuclearDataManager in manager.py * moved unit tests for NuclearDataManager and nuclear data models * refactor import path for Mass and UnitType in test_constants.py * refactor import path for models in test_transmissions.py * add example usage for RadiusParameters, ResonanceEntry, IsotopeParameters, and nuclearParameters in parameters.py * add example usage for FitConfig in config.py * refactor get_isotope_info to accept string input and enhance isotope data handling * refactor IsotopeParameters to use NuclearDataManager and make fields optional * add unit tests for RadiusParameters, ResonanceEntry, IsotopeParameters, and nuclearParameters * refactor NuclearDataManager to improve isotope data handling and add abundance/spin setting functionality * refactor IsotopeInfo to rename atomic_mass to mass_data for clarity * adding resonance table * refactor NuclearDataManager to streamline abundance and spin setting, and remove unused cross-section data reading method * refactor IsotopeInfo to make atomic_number and mass_data optional for improved flexibility * refactor IsotopeInfo to add material_number field for enhanced isotope data representation * refactor NuclearDataManager to update isotope parameter type and set atomic_number for improved data handling * refactor IsotopeInfo to remove unused classes and methods for cleaner codebase * refactor NuclearDataManager to remove unused CrossSectionPoint and IsotopeIdentifier imports for cleaner code * refactor IsotopeParameters to replace isotope_name with IsotopeInfo for improved data handling * moved experimental.py to experimental/parameters.py * added fp05 user resolution function. * refactor import paths for PhysicsParameters to align with new directory structure * add working directory structure documentation * update working directory structure documentation with examples and new fitting directories * 45 unit tests (#120) * add README for isotope information files * Deleted *-n.tot files as they are not longer needed. * refactor: rename mass data retrieval method and improve error handling * refactor: update IsotopeParameters to use vary_abundance and remove from_name method * refactor: update isotope handling in nuclearParameters to use isotope objects and improve validation * refactor: simplify isotope tests and enhance IsotopeInfo functionality * refactor: remove unused experimental tests and clean up constants test * feat: add method to download and extract ENDF resonance parameter files * feat: add imports for handling HTTP requests and ZIP file extraction * feat: add isotope manager for handling isotope data files in PLEIADES * feat: add IsotopeInfo and IsotopeMassData models for isotope representation * moved isotope files to isotope/files/ * feat: implement IsotopeManager for managing isotope data files and caching * feat: add documentation and models for isotopic data representation * test: add unit tests for IsotopeManager functionality * test: add unit tests for IsotopeInfo and IsotopeMassData models * migrated classes in parameters.py to models.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * migrated several isotope functions from nuclear manager to isotope manager. * refactor: remove obsolete unit tests for nuclear parameters * test: add moved unit tests for RadiusParameters, ResonanceEntry, IsotopeParameters, and NuclearParameters models to test_models.py. Used to be in test_parameters.py * refactor: clean up imports in models.py and fix print statement * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * removing test_parameters.py * feat: add methods to retrieve isotope information and mass data to isotopeManager class * refactor: update import path for IsotopeInfo and IsotopeMassData; remove unused class methods and docstrings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * bug: fix isotope string matching in get_isotope_info method for case-insensitivity * feat: add tests for isotope information retrieval and mass data validation in test_manager * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * refactor: remove default value for endf_library in IsotopeInfo model. Moved endf_library to nuclear models * refactor: remove endf_library assertion from test_isotope_info_defaults * feat: add EndfLibrary enum and associate it with IsotopeParameters model * feat: implement isotope parameter creation and error handling in NuclearDataManager * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: correct typo in IsotopeParameters instantiation * fix: correct field names and set default values in IsotopeParameters model * fix: ensure material number is set for isotopes in get_isotope_info method * refactor: remove unused tests and clean up test_create_isotope_parameters methods * fix: correct typo in isotope_information attribute and remove invalid test case * fix: correct typo in isotope_infomation attribute in nuclearParameters validation * refactor: remove obsolete test files for isotope and nuclear data managers * test: add unit tests for IsotopeManager and NuclearDataManager classes * feat: add moved PhysicsParameters and related classes for energy and normalization parameters to models.py * fix: update import path for PhysicsParameters in config.py * fix: update import path for PhysicsParameters in test_fit_config.py * test: add unit tests for EnergyParameters, NormalizationParameters, BroadeningParameters, UserResolutionParameters, and PhysicsParameters * fix: update import path for VaryFlag and helper functions in data_reduction.py * fix: update import path for VaryFlag and helper functions in external_r.py * fix: update import path for VaryFlag in paramagnetic.py * fix: update import path for VaryFlag in radius.py * fix: update import path for VaryFlag in resonance.py * fix: skip tests in TestBackgroundParameters due to non-implementation * fix: skip tests in test_broadening.py due to non-implementation * fix: skip tests in test_data_reduction.py and test_det_efficiency.py due to non-implementation fix: skip tests in test_external_r.py due to non-implementation * fix: skip tests in test_isotope.py, test_last.py, test_misc.py, test_normalization.py, and test_orres.py due to non-implementation * fix: add import for IsotopeParameters in isotope.py * fix: remove skip decorator from TestBackgroundParameters due to non-implementation * fix: remove skip decorators from test functions in test_broadening.py due to implementation * fix: remove skip decorators from test functions in test_data_reduction.py due to implementation * fix: remove skip decorator from TestDetectorEfficiencyParameters as functionality is now implemented * fix: remove skip decorators from TestExternalREntry and TestExternalRFunction as functionality is now implemented * fix: remove skip decorators from test functions in test_last.py, test_misc.py, test_normalization.py, and test_orres.py as functionality is now implemented * fix: update import path for nuclearParameters in config.py * fix: update import path for nuclearParameters in test_fit_config.py * fix: simplify assertions in test_fit_options.py for boolean values * fix: remove transmission.py as it is no longer needed * fix: remove test_transmissions.py as it is no longer needed * fix: remove ex027.ipynb as it is no longer needed * fix: set default values for energy and normalization parameters in models.py * fix: update FitConfig to use Optional for parameters with default None * fix: correct typos in alphanumericOptions.notes * fix: correct typos in working_dir.map for dummy.parfile * fix: correct typos in comments and logging messages in parfile.py * fix: correct typo in options description in lpt.py * fix: correct typo in options description in pcm_in.py --------- Co-authored-by: Alexander Long <alexlong@lanl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Refactor pyproject.toml for improved configuration and versioning - Updated project metadata including dynamic versioning and license information. - Added project URLs for homepage, repository, documentation, and issues. - Enhanced dependencies with specific version constraints for nova-galaxy. - Configured versioningit for automatic version management. - Streamlined setuptools configuration for package discovery and data inclusion. - Updated pytest configuration with new markers and refined options. - Adjusted ruff configuration for linting with updated line length and exclusions. - Introduced pixi configuration for packaging tasks and dependencies management. - Organized feature dependencies for testing, packaging, development, documentation, and Jupyter integration. * fix deprecated API call issue to nova * Add configuration files for GitHub workflows and update pyproject.toml with new tasks * Update installation instructions and add SAMMY check script * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typos in documentation and error messages in dcm.py Update exclusion patterns in pre-commit configuration for clarity * Update exclude patterns in pre-commit configuration for consistency * Add global configuration management and unit tests for PleiadesConfig * Implement caching and data retrieval for nuclear data files in NuclearDataManager - Add cache initialization and directory structure for ENDF/JENDL/JEFF data files. - Enhance download functionality with support for IAEA data source. - Introduce DataSource enum for better data source management. - Update tests to cover new caching and downloading features. * Add ENDF data retrieval and caching functionality in NuclearDataManager - Implement filename patterns for ENDF libraries to standardize cache file naming. - Enhance the NuclearDataManager to support both MAT_FIRST and ELEMENT_FIRST patterns. - Update unit tests to validate cache file path generation for different library formats. * update output to match first time running condition * Refactor nuclear data retrieval methods and update related functionality - Renamed DataSource enum to DataRetrievalMethod to better reflect its purpose. - Updated NuclearDataManager to use the new DataRetrievalMethod enum for cache initialization, file path generation, and data retrieval methods. - Modified methods to handle both DIRECT and API retrieval methods, including changes to file naming conventions based on the method used. - Updated PleiadesConfig to reflect the new retrieval methods and their corresponding URLs. - Refactored unit tests to accommodate changes in the data retrieval methods, ensuring proper coverage for both DIRECT and API methods. - Removed references to the NNDC data source as it is not yet implemented. * Migrate logging from Python's native logging to Loguru and update logger configuration * 117 physics examples (#126) * moved notebook to examples/notebooks * adding data files to build examples around * moved ipynb file to examples/notebooks. * adding all the silicon example files from sammy to pleiades examples. * remove ex012a notebook and parameter file from samexm examples * Adding example ex027 from sammy to pleiades examples * Made python notebook based on ex012. * Wrapped up initial parts of notebook. Need to implement results and plotting classes before moving forward. * Add SAMMY Exercise EX027 notebook for generating parameter files from ENDF files * Fix execution count and ensure working directories are created in the SAMMY exercise notebook * Update examples/Notebooks/pleiades_Si_transmission.ipynb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * had to modify example 027 naming scheme * got rid of unneeded commands in input file * Use relative paths for input, parameter, and data files in SAMMY command execution * Remove obsolete symlink for ex027.dat in examples/samexm/ex027/endf * Update SAMMY_OUTPUT_FILES to reflect correct output file names * Refactor SAMMY exercise notebook to use persistent working directories and improve output handling * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correcting error in name of notebook * Format SAMMY_OUTPUT_FILES for consistency * IDK why my edits were written over. rewriting them * got rid of timestamp * Modified working_dir to be in ./workspaces * adding endf_dummy.dat file for example 027. * Update data file reference in SAMMY example to use endf_dummy.dat * Update SAMMY example notebook to include endf_dummy.dat and enhance output logging * Enhance mock_sammy_files fixture to copy test input files to a temporary directory for path safety * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change script shebang from csh to bash for compatibility --------- Co-authored-by: Alexander Long <alexlong@lanl.gov> Co-authored-by: Chen Zhang <zhangc@ornl.gov> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Loguru migration (#127) * Migrate logging from Python's native logging to Loguru across multiple modules * Migrate logging from Python's native logging to Loguru in manager and factory modules; add loguru log capture fixture for testing * Migrate logging from Python's native logging to Loguru in multiple parameter files; update logger configuration and debug statements * Migrate logging from Python's native logging to Loguru in misc.py; update warning and info logging statements * update notebook to use loguru for console logging * Update logging configuration to create log files in a dedicated directory; enhance logger initialization across multiple modules * Add PLEIADES Logging System Tutorial Notebook. * Update src/pleiades/sammy/parameters/external_r.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix incorrect shebang --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Sammy files handle update (#129) * update deps * Implement file management in SammyFiles: add move_to_working_dir and cleanup_working_files methods with tests * Update src/pleiades/sammy/backends/local.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add shlex import for command line parsing in local backend * update endf example notebook and fix sammyFile handler * update Si transmission notebook --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 93 result visualization 1 (#130) * Add data models for isotope abundance and results mapping * Porting plotting functions for LST files from v1.0 to v2.0 * moved last remaining notebook to examples/notebooks/ * Add LstData class for loading and validating SAMMY .LST files * Enhance PLEIADES tutorial by adding SAMMY result loading and plotting sections * Working on adding capabilties to read .LPT files * Updated directory structure in repo.map to reflect current repo structure * renamed file for data models for isotope abundance and results mapping. Used to be results_maps.py * Add FitResults and RunResults models for SAMMY data aggregation * Implement LPT file processing and block splitting functionality * Add function to extract results from LPT block strings, or fit iterations, and return FitResults object * Refactor FitResults and RunResults models to use default_factory for data initialization and improve method organization * Add method to append isotopes to nuclear parameters and log the action * Refactor ResultsManager class to encapsulate fit result management. * Move lpt.py to lpt_manager.py and added class for managing and extracting results from SAMMY LPT files * Remove unused method get_single_fit_results from RunResults class * Refactor ResultsManager to initialize with file paths and manage LPT files * Add comments to clarify initialization of managers in ResultsManager * Refactor LptManager to initialize with file path and process LPT files on instantiation * Refactor LptManager to streamline processing of LPT file blocks by removing debug print statement * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix IsotopeParameters to set default value for isotope_infomation field * Refactor IsotopeMassData and IsotopeInfo models to use Optional fields with default values * Refactor LptManager to enhance isotope extraction with regex matching and improve data handling * Refactor RadiusParameters to use Optional fields with default values for improved flexibility * Refactor LptManager to enhance isotope and radius extraction, and add broadening parameter handling * Add extract_normalizations_info method to LptManager for normalization data extraction * Refactor LptManager to enhance broadening parameter extraction with varied flag handling * Refactor LptManager to improve broadening and normalization parameter extraction, enhance initialization with RunResults, and add utility functions for value parsing. * Refactor ResultsManager to enhance LptManager initialization with RunResults and remove unused parameters. * Refactor FitResults to integrate chi-squared calculations and enhance initialization with default values. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor LptManager to remove debug print statements and standardize value extraction using split_lpt_values. * Remove commented expectation for number of values in background line parsing * Add chi-squared extraction to LptManager for enhanced result analysis * Rename Chi2Results to ChiSquaredResults and update related attributes for consistency * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Enhance LptManager class documentation and update attribute names for clarity * Implement LstManager class to manage and extract results from SAMMY LST files * Implement LstManager initialization in ResultsManager and add print_results_data method for improved data output * Initialize fit_results list and LstData container in RunResults class * Update LstData column names for clarity and consistency with SAMMY output * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor LstData class to update column names for SAMMY LPT files and improve data loading logic * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor sammyData class to improve data handling and update data_file type to Optional[Path] * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor LstManager to use sammyData instead of LstData and update type annotations for improved clarity * Refactor ResultsManager to use Path for file paths and improve type handling * Refactor RunResults to use sammyData instead of LstData for improved data handling * Refactor ResultsManager to streamline initialization and enhance fit result logging * Add plotting methods for transmission and cross-section data in ResultsManager and sammyData * Remove unnecessary import of matplotlib in plot_cross_section method of sammyData * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Enhance transmission data plotting in sammyData to optionally show differences * Refactor plot_transmission method to enhance visualization and add residuals plotting * Enhance plot_transmission and plot_cross_section methods to support optional parameters for showing differences and plotting uncertainty * Update SAMMY results loading and visualization in pleiades_Si_transmission notebook * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor tests to replace dataParameters with sammyData and update assertions for default and custom values * Refactor test_fit_config to replace dataParameters with sammyData for consistency and clarity * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor FitConfig to replace dataParameters with sammyData for consistency * Remove data_file parameter from sammyData in test_fit_config_custom_values for consistency * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove data_file parameter from test_sammy_data_custom_values for consistency * Add unit tests for FitResults and RunResults initialization and updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Improve error handling in print_fit_result and print_results_data methods * Add unit tests for ResultsManager methods and logging integration * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * run example notebook and keep results * Fix class name casing for SammyData in options.py * Fix typo in isotope_information field name in IsotopeParameters model * Fix typo in isotope_information field name in create_isotope_parameters_from_string method * Fix class name casing for SammyData in multiple files * Fix typo in isotope_information field name in test cases * Fix typo in isotope_information field name in nuclearParameters class * Refactor property accessors in SammyData to use get() for safer data retrieval * Add logger initialization to options.py for improved logging * Add plot_transmission function for visualizing run results with optional residuals * Moved all sammy plotting functionality to sammy/results/plotter.py. This plotting.py file will be used for more image plotting with pleiades * Updated Si Notebook for new plotting routines. --------- Co-authored-by: Alexander M. Long <alexlong@lanl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Chen Zhang <chenzhang8722@gmail.com> * SAMMY inp module (#131) * Add RMatrixOptions class and corresponding unit tests * Add CrossSectionOptions class and unit tests for option validation * Add ENDFOptions class and unit tests for option validation and dependencies * Add BayesSolutionOptions class and unit tests for option validation and exclusivity * Add BroadeningOptions class and unit tests for option validation and exclusivity * Add alphanumeric data input options and tests for covariance matrix and multiple scattering corrections - Implemented `CovarianceMatrixOptions` class for covariance matrix data input control. - Added `ExperimentalDataInputOptions` class for experimental data input control. - Created `MultipleScatteringCorrectionsOptions` class for handling multiple scattering corrections. - Developed unit tests for each of the new options classes to ensure correct behavior and mutual exclusivity. - Added test cases for valid and invalid combinations of options to validate the functionality. * Add covariance matrix output options and associated tests - Implement CovarianceMatrixOutputOptions class for managing output options related to covariance matrices. - Introduce validation to ensure mutually exclusive options are handled correctly. - Create unit tests for CovarianceMatrixOutputOptions to verify default values, valid combinations, and error handling for mutually exclusive options. Add unit tests for cross section options - Implement tests for CrossSectionOptions to validate default settings, individual option handling, and mutually exclusive options. - Ensure comprehensive coverage of all possible configurations and expected behaviors. Add unit tests for LPT output options - Create tests for LPTOutputOptions to check default values, valid combinations, and error handling for mutually exclusive options. - Validate the correct generation of alphanumeric commands based on selected options. Add unit tests for quantum numbers options - Implement tests for QuantumNumbersOptions to verify default settings, valid combinations, and mutually exclusive options. - Ensure accurate command generation based on selected options. Add unit tests for covariance matrix input options - Create tests for CovarianceMatrixOptions to validate default values, individual option handling, and mutually exclusive options. - Ensure comprehensive coverage of all possible configurations and expected behaviors. Add unit tests for R-matrix options - Implement tests for RMatrixOptions to verify default settings, valid combinations, and mutually exclusive options. - Validate the correct generation of alphanumeric commands based on selected options. * Add AveragesOptions and URROptions classes with validation and command generation methods * Add plot file and special analysis options with validation and tests - Implemented PlotFileOptions class for managing plot file configurations, including energy units, ODF file options, plot generation, and theoretical uncertainties. - Added SpecialAnalysisOptions class for special analysis configurations, including cross section reconstruction, uncertainty multipliers, and matrix generation. - Introduced validation for mutually exclusive options in both classes to ensure correct configurations. - Developed comprehensive unit tests for both PlotFileOptions and SpecialAnalysisOptions to verify default values, option exclusivity, and command generation. - Created test cases for physical constants and angular distribution options to ensure functionality and correctness. * Refactor code structure for improved readability and maintainability * Add P-Covariance Matrix Output, Physical Constants, Plot File, R-Matrix, and Special Analysis Options * Refactor FitOptions class to integrate alphanumerics modules and enhance validation; update tests for default and custom configurations * Add InpManager class for managing SAMMY input files with FitOptions integration; include tests for initialization, command generation, and file writing * Enhance InpManager class to support additional parameters and generate corresponding sections; update tests for initialization and content generation * add viztracer for future performance benchmark * add example usage for inp_manager in notebooks * 50.1 parameter workflow (#133) * Add .scratch/ to .gitignore to ignore any testing or drafting files * Implement ParManager class for SAMMY parameter file management. Starting with extract_resonance_entrries() * Added notes on the SAMMY parameter file based on SAMMY manual. * Add SAMMY output list file with column descriptions for results plotting * Created notes for SAMMY input files. * Fixed error in doc string of IsotopeParameters * Fix formatting in SAMMY parameter file notes for clarity on abundance treatment and spin group numbers * Remove unused import of IsotopeCard from parameters initialization * Refactor tests to use Card10 instead of IsotopeCard for isotope data handling * Add Card10 class for handling isotope parameter card sets with format definitions * Add logging and new method for extracting isotope info from mass data * Enhance Card10 class with comprehensive parsing and validation for isotope parameters * Add missing instruction for quantum numbers in example input file * Remove legacy notes files for Pleiades, SammyInputFile, SammyOutputLstFile, and SammyParameterFile * Moved IsotopeCard class and associated parsing logic from isotope.py to sammy/io/card_formats/par10_isotopes.py * Remove __str__ method from IsotopeInfo class to simplify string representation. becuase it was annoying! * Add unit tests for Card10 class to validate isotopes and abundances parsing * Refactor ParManager to extract isotopes and abundances from SAMMY parameter files * placeholder for unit tests for SAMMY parameter file classes * Fix parameter naming convention in SammyParameterFile.notes for to make the pre-commit.ci overlords happy. * adding examples of parameter files from SAMMY runs. These will be used for pleiades examples. * Added append isotope functionality to the FitConfig class. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added more detialed docstrings * Added card headers and moved resonance parsing to par01_resonances.py * create Card01 class to read, parse, and process resonance data from parFiles. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Process Card 10 first in ParManager to extract isotope data before other cards. Added extract_resonance_entries for card01 * Refactor Card01 class to improve resonance parsing and error handling; added fix_pseudo_scientific function for scientific notation correction. * Enhance resonance extraction in ParManager to handle presence or absence of headers; ensure Card 1 is always included in detected cards. * Added placeholder for to_lines method in Card01 class; currenly raises NotImplementedError for output conversion. * Update src/pleiades/sammy/io/par_manager.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor to_lines method in Card01 and Card10 classes to accept FitConfig parameter; update docstrings for clarity. * Add extract_radii_parameters method to ParManager for processing radius data from Card 7 * Change log level from debug to info for header line detection in Card01 class * Add initial implementation of Card07 class for radii processing * Implement Card07 class with from_lines method for parsing isotope parameter cards * Update radius parameter handling in ParManager to support key-word format * Add warning log for missing isotopes in fit_config when creating default UNKN isotope * Refine Card07 class docstring for clarity and detail * Implement Card07a class for parsing radii parameters in SAMMY format * Abundances are initially allowed to be negative in SAMMY, so getting rid of ge=0 in the abundance field of IsotopeParameters. Also got rid of unused where_am_I variables * Moved check_pseudo_scientific() to helper.py * added check_pseudo_scientific() to readin resonance fields in parFile * Add normalization parameter extraction to ParManager for Card 6 * Implement Card06 class for parsing normalization parameters in SAMMY format * Fix attribute name for physics parameters in Card06 class * Add string representation method to NormalizationParameters class * Add string representation method to RadiusParameters class for improved debugging * Implement Card04 class for parsing broadening parameters in SAMMY format * Add string representation method to BroadeningParameters class for improved readability * Add string representation methods for RadiusParameters, ResonanceEntry, and IsotopeParameters classes for improved debugging and readability * Add method to extract broadening parameters from SAMMY parameter files * Refactor logging in Card07a class to use info level for isotope and radius parameter assignments * Add methods to generate and write SAMMY parameter file sections * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add default particle information to nuclearParameters class * Add ParticlePair model to represent pairs of particles in nuclear reaction channels * Enhance ParticlePair class with string representation and add method to append particle pairs in IsotopeParameters * Add particle pair extraction and section generation to ParManager * Add Card04 class for parsing and generating particle pair definitions * Refactor ParticlePair class by removing phase shift calculation and adding Q value and threshold energy fields * Enhance Card04 class to support flexible Q and Threshold parsing, including optional float handling and improved line processing for particle pair definitions. * Add unit tests for Card04 particle pair parsing and validation * Add validation to ParticlePair to ensure q_value and threshold are not set simultaneously * Refactor Card04 class to improve keyword normalization and logging, and enhance particle pair handling for isotopes. * Refactor test suite for Card04 to simplify FitConfig setup and enhance particle pair validation across fixtures * Add SpinGroupChannelInfo and SpinGroups classes for enhanced spin group modeling * Add method to extract spin group definitions from SAMMY parameter files * Add Card10p2 model for INP10 card format to handle spin groups * Enhance Card10 class to support spin group handling and improve to_lines method for formatting * Add blank line termination to Card10 output for improved formatting * Remove obsolete backslash from Card Set 9 description in SammyInputFile.notes * Add string representation methods for SpinGroupChannelInfo and SpinGroups classes for improved debugging and display * Enhance Card10p2 class to improve parsing of spin groups and channel information in INP10 card format * Implement to_lines method in Card01 class for converting fit_config to Card 1 format * Remove commented-out logger info for isotope spin groups in Card07a class * Enhance ParManager to log spin group extraction and update to_lines method for Card classes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add method to generate Input Card 10.2 section in ParManager * Refactor Card10p2 to enhance spin group handling and improve to_lines method for better output formatting * Enhance Card01 to improve spin group handling and output formatting, adding validation for isotopes and refining resonance line generation * Refactor ResonanceEntry __str__ method for improved output formatting, using aligned columns and simplified flag representation * Add empty line at the end of to_lines method in Card10p2 for improved output formatting * Fix Card 10 condition check and adjust section filtering in ParManager for improved data handling * Add to_lines method to Card07a for converting radius parameters to output lines * Refactor Card07a to improve radius parameter handling and output formatting, including enhanced flag conversion and isotope processing * Add generate_par_card7a_section method to ParManager for Card 7a output generation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add to_lines method to Card06 for generating formatted output lines * Uncomment generate_par_card6_section method call in ParManager for improved section generation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update IsotopeInfo model to enforce non-negative mass number and atomic number * Refactor particle pair tests for clarity and consistency; enhance attribute checks and remove unused tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix spin group number validation in IsotopeParameters; ensure correct attribute access and logging * Remove unnecessary warning log for multiple isotopes in Card07a class * debugging spin groups still * adding unit tests. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * still debugging.... * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Working on channel validation. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix bug in get_line_type() * add method to append spin groups in IsotopeParameters * refactor spin group handling in Card10p2 to improve isotope matching and logging * enhance tests for Card10p2: add validation for empty input, bad fit_config, and round-trip serialization * refactor Card01: update isotope handling to use IsotopeParameters for default isotope creation * add unit tests for Card01: implement tests for resonance blocks and header validation * validate fit_config type in Card10p2: ensure it is an instance of FitConfig * add unit tests for Card04: implement tests for broadening parameters and validation * implement to_lines method in Card04: format and return broadening parameters for output * add unit tests for Card06: implement tests for normalization parameters and validation * add unit tests for Card10: implement round-trip tests for standard and extended formats * refactor Card07a: added better radii handling for scenarios with empty isotope lists * add SpinGroupChannels class: implement validation and string representation for spin groups and their channels * refactor Card07a: integrate SpinGroupChannels for improved handling of spin groups and channels * add unit tests for Card07a: implement tests for radii blocks and validation of spin groups and channels * add unit tests for ParManager: implement tests for parameter file reading, extraction methods, and data consistency * refactor IsotopeParameters: improve validation of resonance and radius parameter spin groups by extracting spin group numbers * refactor test_nuclear_models: update RadiusParameters tests to use SpinGroupChannels and validate spin group initialization * delete test_parfile: remove obsolete unit tests for SAMMY parameter file parsing * refactor ParManager: replace direct imports with alias imports for card formats. Moved all imports to top of file * Update src/pleiades/utils/helper.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/sammy/io/card_formats/par10_isotopes.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/sammy/io/card_formats/par10_isotopes.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/sammy/io/card_formats/par01_resonances.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add column ranges for parsing resonance data in Card01 class * Update unit test docstrings for Card 1, Card 4, Card 6, Card 7a, and Card 10 classes * Update parameter documentation from 'Parameters' to 'Args' in parse_keyword_pairs_to_dict function * Remove unnecessary comment in Card10 class to improve code clarity * Remove commented-out assertions in TestNuclearParameters to enhance code clarity * Clarify comment on trailing blank lines handling in Card07a class --------- Co-authored-by: Alexander Long <alexlong@lanl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 57 normalization good (#134) * started signature for normalization. this refs #57 * Definition of the input parameters. Checking validity. Listing most dominant files. this refs #57 * Load files and unit tests. this refs #57 * Added dependency. Rebin code and started unit tests. this refs #57 * all unit tests for rebin. this refs #57 * crop code and unit test. this refs #57 * fixed unit tests and code. this refs #57 * combine, code and tests. this refs #57 * Added code to test normalization. this refs #57 * added needed packages. this refs #57 * fixed a few bugs. Added logger. this refs #57 * added dependency. working on retrieving proton charge and time spectra infos. this refs #57 * get proton charge unit tests. this refs #57 * refactoring code to make it work with timepix. this refs #57 * refactoring the way the data and metadata for each sample and ob are stored. this refs #57 * shutter counts retrieved. this refs #57 * adding shutter values for each image. this refs #57 * refactorization and improved log messages. this refs #57 * Added dependency (tomopy). Implemented remove outliers. this refs #57 * Refactoring and regrouping at the top the common methods, rebin, loading. this refs #57 * combine obs working. this refs #57 * combine data. this refs #57 * normalization. this refs #57 * More refactoring and applying proton charge and shutter counts ahead of normalization loop. this refs #57 * normalization with code in main file. this refs #57 * added code and unit test to switch units from lambda to ev. this refs #57 * Fixed unit tests. this refs #57 * unit conversion. this refs #57 * code to convert time spectra into energy. this refs #57 * Fixed conversion to energy units. this refs #57 * producing time spectra for LANL data set. this refs #57 * Roi takes x2 or width and y2 or height. Added unit tests. this refs #57 * full process works for ORNL data. this refs #57 * Added default uncertainties for now. this refs #57 * forgot save. this refs #57 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated pixi.lock file. this refs #57 * fix import error * adjust importing order * Update src/pleiades/utils/units.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/utils/units.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/unit/pleiades/utils/test_load.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/processing/normalization.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Improved doc of normalization. Make unit tests I wrote conform to the rest. this refs #57 * started moving from os to Pathlib. this refs #57 * fixed doc. this refs #57 * fixed doc with missing ev. this refs #57 * fixed format of files.py. this refs #57 * added doc. this refs #57 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated doc. this refs #57 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add missing import * update test to match code behavior --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Chen Zhang <zhangc@ornl.gov> Co-authored-by: Chen Zhang <chenzhang8722@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Complete end to end integration for VENUS (#135) * Fix division by zero errors and improve transmission calculation in normalization workflow * Enhance normalization export functionality to handle multiple sample runs and calculate combined transmission results * fix incorrect data clipping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add twenty formater * add new json manager for multi-fit route * update json manager and expand test coverage * fix endf and json pairing logic * update runner to support multi mode * add multi-isotope configuration support in FitOptions and InpManager * add multi-isotope INP generation and number density calculation functions * add plot file options and enhance physical constants generation in InpManager * add isotope section generation and update tests for multi-isotope handling * add integration notebook * add end to end notebook * fix lpt parser bugs sneaked in previous PR * enhance isotope section generation to use Card Set 2 format and update tests accordingly * fix missig new line issue * adjust default alphanumerics * refactor FitOptions to use Optional types for several attributes to improve flexibility --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Enhance CSV conversion functionality in data_manager (#138) * Enhance CSV conversion function to support both tab- and comma-separated formats, and improve handling of 2-column input by adding uncertainty column. Update documentation for clarity. * Modified docstring for convert_csv_to_sammy_twenty to clarify input CSV format * Update src/pleiades/sammy/io/data_manager.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/sammy/io/data_manager.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * WIP: local changes before pulling * Update src/pleiades/sammy/io/data_manager.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pleiades/sammy/io/data_manager.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor data reading in convert_csv_to_sammy_twenty to use a list comprehension for better clarity --------- Co-authored-by: Alexander M. Long <alexlong@lanl.gov> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Proper VENUS End-to-end integration (#140) * adjust default inp options * add ROI to exclude sample holder * add new ornl spefici normalization modules * add ornl normalization pipeline * deprecate original normalization module * add normalization router * update example usage * Add pleiades_data submodule for large test datasets * Quality of life improvement (#142) * robust handling of white space delimenator * improved demo notebook for using PLEIADES at VENUS * update demo notebook to use proper visualization func * enable figure customization * Implement placeholders and TODOs for SAMMY and PLEIADES modules * Refactor: Remove unused example code and async context manager from SammyRunner; add TODOs for background, detector efficiency, last card, and resolution parameter parsing and formatting * Enhance type hints for function signatures in lpt_manager, models, config, and helper modules * Refactor: Improve exception handling in file deletion and parsing functions * fix potential security risk (shell injection) * Update src/pleiades/utils/helper.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * INP manager refactor (#143) * Implement Card Set 2 (Element Information) for SAMMY INP files with parsing and generation functionality * Add Card Set 3 (Physical Constants) implementation and tests for SAMMY INP files * Add Card03Density class and unit tests for sample density in SAMMY INP files * Refactor InpManager to remove unused normalization parameters and update element information formatting * Update InpManager to use default values for title and reaction type in generated sections * update pixi lock file * Improve test coverage (#147) * Add UserResolutionParameters and IsotopeCard for backward compatibility * Add comprehensive unit tests for LptManager and related functions * Add comprehensive tests for load functions and improve error handling * Add comprehensive unit tests for LstManager and related functionalities * further improve test coverage * exclude depreated module in test cov calc * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * do not pre-comiit check legacy code --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alexander Long <along4@users.noreply.github.com> Co-authored-by: Alexander M. Long <alexlong@lanl.gov> Co-authored-by: Alexander Long <alexanderlong5@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jean Bilheux <bilheuxjm@ornl.gov>
1 parent 0144279 commit 7212879

File tree

311 files changed

+151160
-1511950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+151160
-1511950
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
3+
4+
# Do not consider Jupyter as a language
5+
*.ipynb linguist-vendored

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Workflow files stored in the default location of `.github/workflows`
10+
schedule:
11+
interval: "weekly"

.github/workflows/package.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: conda packaging and deployment
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [qa, main]
7+
tags: ['v*']
8+
9+
jobs:
10+
linux:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: prefix-dev/setup-pixi@v0.8.5
15+
with:
16+
pixi-version: v0.41.4
17+
manifest-path: pyproject.toml
18+
- name: build conda package
19+
run: |
20+
echo "build and verify conda package"
21+
pixi run verify-conda
22+
- name: upload conda package to anaconda
23+
if: startsWith(github.ref, 'refs/tags/v')
24+
env:
25+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
26+
IS_RC: ${{ contains(github.ref, 'rc') }}
27+
run: |
28+
# label is main or rc depending on the tag-name
29+
CONDA_LABEL="main"
30+
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
31+
echo pushing ${{ github.ref }} with label $CONDA_LABEL
32+
pixi run anaconda upload --label $CONDA_LABEL --user neutrons conda.recipe/noarch/mypackagename*.tar.bz2
33+
34+
pypi-publish:
35+
name: upload release to PyPI
36+
runs-on: ubuntu-latest
37+
permissions:
38+
# IMPORTANT: this permission is mandatory for trusted publishing
39+
id-token: write
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: prefix-dev/setup-pixi@v0.8.5
43+
with:
44+
pixi-version: v0.41.4
45+
manifest-path: pyproject.toml
46+
- name: build pypi package
47+
run: |
48+
# build the package
49+
VERSION=$(pixi run -- versioningit .)
50+
pixi run -- python -m build
51+
# publish your distributions here (need to setup on PyPI first)
52+
- name: Publish package distributions to PyPI
53+
if: startsWith(github.ref, 'refs/tags/v')
54+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/unittest.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: unit-test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [next, qa, main]
8+
tags: ['v*']
9+
10+
jobs:
11+
linux:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: prefix-dev/setup-pixi@v0.8.5
16+
with:
17+
pixi-version: v0.41.4
18+
manifest-path: pyproject.toml
19+
- name: run unit tests
20+
run: |
21+
echo "running unit tests"
22+
pixi run test
23+
# - name: upload coverage to codecov
24+
# uses: codecov/codecov-action@v5
25+
# if: github.actor != 'dependabot[bot]'
26+
# with:
27+
# token: ${{ secrets.CODECOV_TOKEN }}
28+
# - name: build conda package
29+
# run: |
30+
# echo "build and verify conda package"
31+
# pixi run verify-conda
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update lockfiles
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
workflow_dispatch:
9+
schedule:
10+
- cron: 0 5 1 * *
11+
12+
jobs:
13+
pixi-update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up pixi
18+
uses: prefix-dev/setup-pixi@v0.8.5
19+
with:
20+
run-install: false
21+
- name: Update lockfiles
22+
run: |
23+
set -o pipefail
24+
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
25+
- name: Create pull request
26+
uses: peter-evans/create-pull-request@v7
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
commit-message: Update pixi lockfile
30+
title: Update pixi lockfile
31+
body-path: diff.md
32+
branch: update-pixi
33+
base: main # change this to the default branch of your repository
34+
labels: pixi
35+
delete-branch: true
36+
add-paths: pixi.lock

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,16 @@ cython_debug/
201201

202202
# Ignore vscode stuff.
203203
.vscode/
204+
205+
# Ignore development work files (use Github issues instead)
206+
docs/project_management
207+
208+
# pixi environments
209+
.pixi
210+
*.egg-info
211+
212+
# ignore versioning git files
213+
_version.py
214+
215+
# ignore any scratch spaces or temporary files
216+
.scratch/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tests/data/pleiades_data"]
2+
path = tests/data/pleiades_data
3+
url = git@code.ornl.gov:sns-hfir-scse/infrastructure/test-data/pleiades_data.git

.pixi/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
detached-environments = true

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ repos:
99
args: [--allow-multiple-documents]
1010
exclude: "conda.recipe/meta.yaml"
1111
- id: end-of-file-fixer
12-
exclude: "nucDataLibs/.*"
12+
exclude: "(tests/data/.*|legacy/.*|src/pleiades/nuclear/isotopes/files/.*|src/pleiades/nuclear/isotope/files/.*|src/pleiades/nuclear/resonances/.*)"
1313
- id: trailing-whitespace
14-
exclude: "nucDataLibs/.*"
14+
exclude: "(tests/data/.*|legacy/.*|src/pleiades/nuclear/isotopes/files/.*|src/pleiades/nuclear/isotope/files/.*|src/pleiades/nuclear/resonances/.*)"
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
rev: v0.11.2
1717
hooks:
1818
- id: ruff
1919
args: [--fix, --exit-non-zero-on-fix]
20-
exclude: "nucDataLibs/.*"
20+
exclude: "(tests/data/.*|legacy/.*|src/pleiades/nuclear/isotopes/files/.*|src/pleiades/nuclear/isotope/files/.*|src/pleiades/nuclear/resonances/.*)"
2121
- id: ruff-format
22-
exclude: "nucDataLibs/.*"
22+
exclude: "(tests/data/.*|legacy/.*|src/pleiades/nuclear/isotopes/files/.*|src/pleiades/nuclear/isotope/files/.*|src/pleiades/nuclear/resonances/.*)"
2323
- repo: https://github.com/codespell-project/codespell
2424
rev: v2.4.1
2525
hooks:
2626
- id: codespell
27-
exclude: "(nucDataLibs/.*|.*\\.ipynb)|poetry.lock"
27+
exclude: "(tests/data/.*|legacy/.*|.*\\.ipynb|pixi.lock|src/pleiades/nuclear/isotopes/files/.*|src/pleiades/nuclear/isotope/files/.*|src/pleiades/nuclear/resonances/.*|src/pleiades/sammy/alphanumerics/.*\\.(md|yaml|yml))"
2828
args: ["--ignore-words-list=DELTE"]

Notes/Pleiades.notes

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)