Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces randomization options for data loading, implementing new methods for saving data and optimized integration, and extending utility functions for better modularity and usability.
Enhancements to
community.py
:randomize
parameter to theload_data
method, allowing random sampling for consumer preference and metabolic matrices. This change improves flexibility in data initialization. [1] [2]save_data
method: Introduced a method to save the community's data (parameters, metabolic matrices, consumer preferences, and leakage coefficients) to specified paths, improving reproducibility and data management.optimized_integrate
method to perform numerical integration in batches, with species presence thresholds and early stopping to enhance computational efficiency.Enhancements to
utilities.py
:extract_d_matrices
: Added ause_dirichlet
parameter to allow flexibility in generating metabolic matrices, enabling or disabling Dirichlet sampling.next_experiment_path
function: Added a utility function to determine the next experiment folder path in a directory, aiding in experiment organization. The idea is to have 4-digit folder names, starting with 0001. This is used for batch_results directories containing simulation results with randomized matrices.These updates collectively improve the modularity, flexibility, and efficiency of the codebase, particularly for simulations and data management workflows.