Skip to content

Dev #4

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

Merged
merged 5 commits into from
May 12, 2025
Merged

Dev #4

merged 5 commits into from
May 12, 2025

Conversation

NomadicPython
Copy link
Owner

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:

  • Randomization in data loading: Added a randomize parameter to the load_data method, allowing random sampling for consumer preference and metabolic matrices. This change improves flexibility in data initialization. [1] [2]
  • New 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 integration: Added an optimized_integrate method to perform numerical integration in batches, with species presence thresholds and early stopping to enhance computational efficiency.

Enhancements to utilities.py:

  • Fixed extract_d_matrices: Added a use_dirichlet parameter to allow flexibility in generating metabolic matrices, enabling or disabling Dirichlet sampling.
  • New 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.

@NomadicPython NomadicPython merged commit 0e9d7f6 into main May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant