Releases: nmfs-ost/ageproR
Releases · nmfs-ost/ageproR
ageproR version 0.9.0
- Default current version AGEPRO input file format is set to
AGEPRO VERSION 4.25.- Added
agepro40_inpfile_stringforAGEPRO VERSION 4.0compatibility. - Improved AGEPRO Input File Format Version validation command line messages
- Warning message is more clarified if
AGEPRO VERSION 4.0was detected. - Assert for valid strings and supported input file formats
- Warning message is more clarified if
- Added
- Auxiliary Output Flag (
auxfile_output_flag)- All remaining instances of
output_stock_summarywere renamed toauxfile_output_flag.- Renamed JSON field
summary_output_flag->auxiliary_output_flag - options_output: param
summary_report->auxiliary_flag
- Renamed JSON field
- Additional Auxiliary Output Flag parameter added to match specifications introduced in AGEPRO-GUI 4.3.6 and the December 2025 version of the AGEPRO Reference Manual (#98)
- Supported Input File format validation is based on "Current Version" and
AGEPRO VERSION 4.0Input File Format (enable_agepro40_format):- If
enable_agepro40_formatis TRUE, check if value is logical or (0,1); if FALSE, check if value matches one of the Valid Auxiliary Output Flags (valid_aux_output_flags = c(0,1,2,3,4)).
- If
- All remaining instances of
- Updated testthat example to use AGEPRO Calculation Model's 4.25 updated Example 1 Input Model:
- Added AGEPRO Example 1 (
AGEPRO VERSION 4.25input format);- Exported Example 1 Model data to new example JSON file
Example1.json
- Exported Example 1 Model data to new example JSON file
test-agepro_model.R: Added checks to see if Example1 Input File and Bootstrap File Exists. Removedset_bootstrap_filetest- Previous example test example file
ageproInput.INPis replaced by AGEPRO_GUI Example 4 (AGEPRO VERSION 4.0)- Added Example 4 Bootstrap File;
Example4_UKU.INP: Modified bootstrap_file to be a relative path.
- Added Example 4 Bootstrap File;
- Added AGEPRO Example 1 (
- bootstrap_file relative filepaths can be verified:
- Check the path of dirname of the input file, being read via file connection, plus the bootstrap_file relative filepath exists.
If found save relative filepath to bootstrap_file. Otherwise, use working directory and use original bootstrap path validation. - This has a side effect of printing out absolute paths which affects testthat snapshots, that varies the output of the
bootstrap_filecausing test snapshot errors.- Fixup
test-agepro_model.R: Substitutebootstrap_fileoutput value path w/ fixed value<path>
- Fixup
- Check the path of dirname of the input file, being read via file connection, plus the bootstrap_file relative filepath exists.
- Refactor out
validate_logical_parameterfunction from validation.R to as aoptions_outputprivate helper method - JSON inupt file
ver_json_formatis now 2 (Changes to the JSON input format will increment up +1)- Fix inconsistencies (
ver_jsonfile_format->ver_json_format) causing NULL values
- Fix inconsistencies (
- JSON fields renamed to be more consistent with the AGEPRO Reference Manual Table 3
summary_output_flag->auxiliary_output_flagprocess_error_aux_data_flag->process_dataflagreport_precentile_value->perc_report_valuebiomass_scale->scale_biomassrecruitment_scale->scale_recruitmentstock_size_scale->scale_stock_size
- Rename
assert_inpfile_version->check_inpfile_version- parameter
process_error_aux_files->process_error_datafiles - function
output_data_frame->export_df - param
export_r_data_frame->export_df
- Bugfixes to
read_inp_filetrycatch error handling.- cli tweaks to show "error conditions"
- Suppress
enable_percentile_summarysetup messages when resetting projection analysis types. - Fixed an erroneous call resetting
enable_percentage_summaryvalue.
- Updated README: Fixes and updated links from nmfs-ost migration (#96, #95)
- Update roxygen to 7.3.3
ageproR version 0.8.0
- Recruitment
- Added
empirical_ssbfor Empirical Recruit Per Spawning Mass Distribution (Recruitment model 2) (#76) - Added
parametric_autocorrelated_erroras a base R6Class for Parametric Recruitment w/ Autocorrelated Lognormal Errors (#75)- Added
berverton_holt_autocorrelated_errorfor Beverton-Holt w/ Autocorrelated Lognormal Error (Model 10) - Added
shepherd_curve_autocorrelated_errorfor Shepherd Curve w/ Autocorrelated Lognormal Error (Model 11) - Added
ricker_curve_autocorrelated_errorfor Ricker Curve w/ Autocorrelated Lognormal Error (Model 12)
- Added
- Recruitment models 2, 10, 11, 12 added to list to valid recruitment numbers, and can be passed through
set_recruit_modelfunction. - Allow active binding recruitment fields (
recruit_scaling_factor,ssb_scaling_factor, andmax_recruit_obs) to be settable. - Empirical observation tables
- Added
obs_tableparameter to set observation data at initialization. Default is NULL, generating default values, the original behavior. - Added method to set empirical recruitment observation data from data frames
- Added
- Recruitment cli tweaks
- cli tweaks improve readability with Recruitment Model and Name on Rconsole.
printnow showsmax_recruit_obs(#71)
- Rename
print_input_option_name->print_process_error_fields - Minor
read_inp_linesmessage tweak to clarify recruitment time period range.
- cli tweaks improve readability with Recruitment Model and Name on Rconsole.
- Consolidated validate_numeric_substrings code into
read_inp_numeric_linesfunction - Added option to toggle verbosity when setting new recruitment models via
set_recruit_model
- Added
- Options
- Consistency cli tweaks between Option classes
- Renamed options-related files with option prefix and simplified some R6Classes names:
- renamed R script
max_bounds.R->options_max_bounds.R - renamed R script
user_percentile_summary.R->options_percentile_summary.R- renamed R6Class
user_percentile_summary->percentile_summary
- renamed R6Class
- renamed R script
reference_points.R->options_reference_points.R - renamed R script
scaling_factors.R->options_scaling_factors.R - renamed R script
retrospective_adjustments.R->options_retrospective_adjustments.R - renamed R script
output_options.R->options_output.R- renamed R6class
output_options->options_output
- renamed R6class
- renamed R script
optional_options_flags.R->option_flags.R- renamed R6Class
optional_optional_flags->option_flags
- renamed R6Class
- renamed R script
- "options w/ options_flags" (option_flag class reference for: max_bounds, percentile_summary, reference_points, scaling_factors, retrospective_adjustments)
- Fixed an issue where option_flags reference class was improperly referenced, causing unintended consequences using multiple agepro_model instances (#85)
- Make option_flag R6class a non-shared Reference, and instantiate reference per agepro_model class instance.
- During agepro_model instantiation, each "options w/ options_flags" is instantiated with an option_flag class reference.
- Use formals to detect parameter defaults to determine option_flag is enabled at initialization:
- max_bounds, percentile_summary, reference_points, scaling_factors: Initialize with a non-default parameter: set its flag to TRUE; If all class parameters match default values, set the flag to FALSE.
- retrospective_adjustments: removed default value for
retro_adjust. Ifretrospective_adjustis missing in a new instances of this class, setenable_retrospective_adjustmentsto FALSE. Otherwise, its TRUE
- Fixed an issue where option_flags reference class was improperly referenced, causing unintended consequences using multiple agepro_model instances (#85)
- Fixup option_flags inconsistencies, messages
- cli consistency tweaks (R message format)
- Reworded Rconsole to represent the keyword parameter class field names.
- Console alert symbols ℹ️ (or
i) focuses on keyword parameter classes fields;◀️ (or<) for a interface event (or input line read)
- Console alert symbols ℹ️ (or
- Output from initializing agepro_model classes or "printing" AGEPRO keyword parameters classes, will print under the R message format.
- This resolves an issue with console output changes with RStudio 2025.05.0+496.
- Pass
print_parameter_tableoutput throughcapture_output_as_message- Replaces use of tibbles for output; Removes tibble dependency.
- Replaces redundant function
cli_print_process_error_tablein process_error class.
- Added verbosity toggle to specifically show General Parameters to R console during agepro_model initialization. TRUE by default.
- Reworded Rconsole to represent the keyword parameter class field names.
- Bootstrap
- Clarified bootstrap_file warning message for relative path cases
- cli fix to show Bootstrap File at agepro_model initialization
- Replace test AGEPRO input File, Bootstrap File, and json input file with AGEPRO-GUI Hawaii Uku Example, based on 2020 Hawaii Uku (Aprion virescens) Assessment.
- Hawaii Uku JSON input file imported from Hawaii Uku AGEPRO input file.
- Added description file of example.
- Added Vignette as "Article" format (#84)
- Includes AGEPRO Input File Keyword Parameter Structure and stub for JSON experimental file
- README update (#88)
ageproR version 0.7.3
agepro_inp_modelcan be initialized with general agepro model parameters. This change will be consistent withagepro_modelandagepro_json_model. (#64)- The default method to generate agepro_inp_model remains the same.
- Fixup/Improve WARNING messages for NULL Recruitment Model Data and Invalid Bootstrap File
- Added
testthatfor basic unit testing scripts (#48)- added withr dependency to help with testthat scripts
- Added
model_nameparameter when initializing case_id. New agepro_model will include "Unnamed AGEPRO model" asmodel_name. - Updated README
- removed redundant
general_paramsparameter checks during agepro_model initialization
ageproR version 0.7.2
- Use version string (line 1) from AGEPRO Input File to correctly check input file version format against the "current version" input file string (
currentver_inpfile_string) - Validation checks for Invalid recruitment model data from NULL or Deprecated Recruitment model 9, when importing and exporting to AGEPRO Input File and JSON Input file (#54)
- Interrupts export to AGEPRO Input File, if invalid recruitment model data found.
- JSON input file: Nullify
recruitData, if invalid recruitment model data found.
- rename
set_projection_analyses -> setup_projection_analyses_value- Function now checks input 'type' parameter value before assigning to projection_analyses_type
- Error message clarifications
ageproR version 0.7.1
Note
This bugfix version reverts AGEPRO Input File format back to the AGEPRO VERSION 4.0.
- Reverted to
AGEPRO VERSION 4.0ascurrentver_inpfile_string. Input files will be written toAGEPRO VERSION 4.0- Supported_inpfile_versions are:
currentver_inpfile_string,AGEPRO VERSION 4.0,AGEPRO VERSION 4.25 write_inp(overwrite_as_currentver = FALSE)save to AGEPRO Input File and keep the supported version of input file (AGEPRO VERSION 4.25)
- Supported_inpfile_versions are:
write_inp: Use withCallingHandlers to properly handle errors when retrieving AGEPRO Input File formatted Strings from keyword parameter classes (get_inp_lines)- Rename agepro_inp_model private helper function
set_inpfile_version -> write_inpfile_version- Includes warning if (Supported) AGEPRO Input File Version is not the "current version"
- Updated Roxygen
ageproR version 0.7.0
Warning
Note: AGEPRO input files will be saved as AGEPRO VERSION 4.25, in reflection to the future 4.25 update to AGEPRO.
- Added AGEPRO optput_options (OPTIONS)
- Added optional options keyword parameters:
- user_percentile_summary (PERC)
- max_bounds (BOUNDS)
- reference_points (REFPOINTS)
- scaling_factors (SCALE)
- retrospective_adjustments (RETROADJUST)
- Data can be imported/exported to AGEPRO Input File and/or Experimental JSON Input File. (#12, #9)
optional_options_flag: a shared Reference class for optional options.- Contains logical flags to allow user to edit optional options fields:
enable_user_percentile_summary,enable_reference points,enable_scaling_factors,enable_max_bounds,enable_retrospective adjustments.- (Re)set to NULL when output options classes is initialized. By default, using initialized default values, set flag to FALSE. Otherwise, set to TRUE. If read from AGEPRO Input File, set to TRUE.
- Due to its shared references nature, explicitly collate
optional_options_flags.Rto load before the optional options class R files in DESCRIPTION.
- Contains logical flags to allow user to edit optional options fields:
- Current AGEPRO Input File version is now
AGEPRO VERSION 4.25(currentver_inpfile_string): Reflecting changes in OPTIONS StockSummaryFlag to the new release the AGEPRO calculation engine.- AGEPRO input files now written to file under
AGERPRO VERSION 4.25; Input data imported fromAGEPRO VERSION 4.0input files will be saved to current version format. - Remove supported AGEPRO Input file version
AGEPRO VERSION 4.2
- AGEPRO input files now written to file under
- Added optional options keyword parameters:
- Changed version json list format Experimental JSON Input File:
- Renamed
version.leagcyVer->version.inpfile_string: Reflects AGEPRO input file version string - Replace
version.verwithversion.jsonfile_format: Numeric for JSON Input File format. Marked JSON format to 0 until AGEPRO Keyword Parameters is implemented on JSON Input File.
- Renamed
- Added diagnostic value
ver_rpackageto return the ageproR version the agepro model was created. - Toy Example AGEPRO Input File
- Changed version of Toy Example AGEPRO Input File to
AGEPRO VERSION 4.0 - Added
PERCandOUTPUTdata to toy Example Agepro Input File
- Changed version of Toy Example AGEPRO Input File to
- Added validation function
validate_logical_parameterto validate, handle, and convert potential logical values as numerical values to output_options active binding fields. - Fixes:
- Fixup/Clarify AGEPRO Input file import error messages
- Fix/updated rstudioapi checking character version strings to see if VSCode is currently used when opening save file dialog. Refactor redundant check functions.
- Added cli prompts when import_agepro_inp_model is used
- Added alternative package install method
pak::pkg_installexample to README.
Full Changelog: v0.6.2...v0.7.0
ageproR version 0.6.2
- Order R6 methods as: public, active, private by @efletcherPIFSC in #51
Full Changelog: v0.6.1...v0.6.2
ageproR version 0.6.1
- Rename
inplines -> inp_linesfor consistency (#37) - Rename general, bootstrap, process_error, and recruitment json_list active binding functions to
json_list_object - process_error (#47)
- Cleanup proj_years validation code
- Moved
setup_projection_tablesas a private helper method.
- Resolved
tibble::as_tibblecolumn name deprecation (#44) - Updated Roxygen Dependency to 7.3.1
ageproR ver 0.6.0
- Added
mortality_fraction_prior_spawn- Data can be imported/exported to AGEPRO Input File/Experimental JSON Input File
- added
BIOLOGICALdata to toy Example Agepro Input File - changing
time_varyingcreates a newproportion_total_mortality_matrixwith default values and the number of columns depends on thetime_varyingstate. The behavior is similar to AGEPRO-GUI. - Explicitly state natural_mortality and fishing_mortailty to
proportion_total_mortality_matrixto avoid ambiguity with gender abbreviations
- Improved projection_years validation: multiple assertions (from the checkmate package) can be prompted to Rconsole.
- Wrapped sequence validation error check as a custom checkmate assertion.
- Fixed multi recruitment model number support for agepro_model
set_recruit_model(#49)- Included multiple assertions (from checkmate) to check
set_recruit_modelargument is a numeric vector that matches a list of valid AGEPRO recruitment model numbers. - Added custom checkmate assertion wrapper to check
set_recruit_modelargument is empty or has multiple arguments.
- Included multiple assertions (from checkmate) to check
- Update DESCRIPTION
ageproR version 0.5.1
- recruitment
- Fixed an issue (#39) where a difference of number of recruitment models using the agepro_model function
set_recruit_modelonly changed the Recruit Data collection object structure but did not change recruitment probability nor thenum_rec_modelsgeneral_param field.- Assert that the count of recruitment model number(s) (
model_num) parameter matchesnum_recruit_modelsparameter at initialization and when importing recruitment data (read_inp_lines) from AGEPRO input files.- Added
num_recruit_modelsparameter to recruitment initialization - Added Sequence years (
seq_years) parameter toread_inp_filesto update number of recruit models
- Added
agepro_model$set_recruit_model: This now initializes a new instance of the recruitment class, using the general_params field number of recruitment models (num_rec_models) value.- Use
purrr::mapto validate input for valid recruitment probabilities within the time projection year horizon for each recruitment model in Recruitment Probability (recruit_probability) active binding setter. Recruitment probabilities can be set after Recruitment - Use
purrr::mapto get (and validate) recruitment model numbers from Recruitment Model Data (recruit_data) input and update the Recruitment Model Number Vector in therecruit_dataactive binding setter.
- Assert that the count of recruitment model number(s) (
- Setter access to general recruitment active binding fields:
recruit_scaling_factor,ssb_scaling_factor,max_recruit_obs,recruit_model_num_list, is set to private. These values can be set using methods of the recruitment class, such as during initialization. - Improved Recruitment Model Number Validation using the agepro_model function
set_recruit_model - Code cleanup for consistency and clarity
- Modularize setups for Recruitment probability(
recruit_probability), Recruitment Model Number vector (recruit_model_num_list), and the Recruitment Model Data (recruit_data) into private helper functions. - Renamed field
model_collection_list -> recruit_datafor clarity. - Renamed common recruit_model active binding
recruit_data -> json_recruit_data - Replaced
observed_yearstosequence_projection_yearsfield. - Renamed recruitment's
set_recruit_modelfunction toinitialize_recruit_modelto reflect its intended functionality and set it as a private helper function. - Renamed field
max_rec_obs -> max_recruit_obs - Renamed recruitment function
inplines_recruit(andinplines_generalfrom general_params) toget_inp_lines(#37) - Renamed recruitment parameter
cat_verbose -> enable_cat_print
- Modularize setups for Recruitment probability(
- Fixed an issue (#39) where a difference of number of recruitment models using the agepro_model function
- Setter access to general_params active binding fields:
yr_begin,yr_end,age_begin,age_end,num_pop_sims,num_fleets,num_rec_models,discards_present,seedis set to private. These values can be set using methods of the general_params class, such as during initialization. This behavior matches AGEPRO-GUI - Simplified projection years validation checks to check for numeric
- Updated roxygen dependency to version 7.3.0
- Replaced deprecated doctype package in with _PACKAGE_ roxygen package documentation (
ageproR.R -> ageproR-package.R)
- Replaced deprecated doctype package in with _PACKAGE_ roxygen package documentation (