Conversation
fix(docs): 📝 adding authors' orcid of the paper
Fix some bugs for setting/getting values and typos in docs
Fixed random list problem
refactored nature patches for more convenience and consistency
…ctor data application This commit modifies the `PatchModule` class to ensure that providing an `attr_name` automatically applies raster data, maintaining backward compatibility with version 0.7.x behavior. The changes include updating the logic for applying raster data and removing unnecessary parameters from the initialization process. Additionally, new tests are added to verify that both raster and vector data are correctly applied when `attr_name` is provided, ensuring consistent behavior across different module creation methods.
…ndency management This commit updates the project to use `uv` instead of `poetry` for environment and dependency management. Key changes include: - Removed Poetry hooks from the pre-commit configuration. - Updated the `contributing.md` and other documentation to reflect the use of `uv` for environment setup and dependency installation. - Modified the Makefile to utilize `uv` commands for installing dependencies, running tests, and serving documentation. - Adjusted the GitHub Actions workflows to install and cache `uv`, ensuring a streamlined CI/CD process. These changes aim to simplify dependency management and enhance the development workflow.
…to uv This commit removes the `poetry.lock` file and updates the `pyproject.toml` to reflect the new dependency management approach using `uv`. Key changes include: - Migration of dependency specifications to the new format in `pyproject.toml`. - Addition of dependency groups for development and documentation. - Update of the `uv.lock` file to include the necessary packages and their versions. - Adjustments to the Python version requirements to ensure compatibility. These changes aim to streamline dependency management and enhance the overall development workflow.
…ne command This commit modifies the `tox.ini` file to remove the `extras` specification, simplifying the dependency management. Additionally, the GitHub Actions workflow is updated to use `uv sync --dev` instead of `uv sync --all-extras`, ensuring a more focused installation of development dependencies. These changes aim to enhance the clarity and efficiency of the project's dependency management process.
…sting and linting This commit modifies the `pyproject.toml` to enhance pytest configuration by adding coverage reporting for the `abses` module. Additionally, it refines the Ruff configuration to better manage linting rules, including the addition of specific error and warning selections. The GitHub Actions workflow is updated to improve cache key generation by including the `uv.lock` file, ensuring more efficient caching. Lastly, the migration guide is updated to clarify logging practices in hooks. These changes aim to streamline testing and linting processes while improving documentation clarity.
This commit modifies the GitHub Actions workflow configuration to remove the `dev` branch from the list of branches that trigger tests on push events. The `pull_request` event configuration remains unchanged, continuing to include `main`, `master`, and `dev`. These changes aim to streamline the testing process by focusing on the primary branches.
This commit updates the GitHub Actions workflow configuration to include concurrency settings, allowing for better management of in-progress jobs. The `concurrency` group is defined to ensure that only one job runs at a time for a given pull request, improving resource utilization and reducing unnecessary job runs. The changes aim to streamline the CI/CD process and enhance the efficiency of testing workflows.
This major refactoring introduces a protocol-based type system and reorganizes the module structure while maintaining backward compatibility for public APIs. Key Changes: - Introduce base classes: BaseModelElement, BaseModule, BaseObservable, BaseSubSystem - Protocol definitions for better type safety - Module reorganization: abses.cells → abses.space.cells, abses.tools → abses.utils - TimeDriver decoupling from model steps - Enhanced type checking configurations (mypy strict mode) Breaking Changes: - Module import paths changed (use public API: from abses import ... to avoid) - _do_each() → do_each() (private to public) - create_module(how=...) parameter removed - agents.select/has signature changes (use agent_type parameter) - agents.apply() removed (use for loop instead) Migration: - Public API users: Zero changes needed ✅ - Internal API users: 15-30 minutes migration - Complete guide: docs/wiki/migration_guide_v0.7.md - Compatibility validated with real research projects Testing: - 33/33 internal example tests passing (100%) - 2/2 external projects compatibility verified - shifting_baseline: zero changes needed - South China Livelihood: 3 minor updates - Test coverage improved by 230% (10 → 33 tests) Examples Enhanced: - fire_spread: Fixed config + detailed README - wolf_sheep: 9 API updates + 15 tests + detailed README - schelling: 8 new tests + detailed README - All examples now showcase framework advantages
Previously used direct attribute access (than.metric) which would fail if 'metric' was a variable name rather than a literal attribute. Changed to use getattr(than, metric) for proper dynamic attribute access. Line 244: than = getattr(than, metric) # was: than = than.metric
…nd CI integration This commit introduces a comprehensive set of layered test commands in the Makefile, allowing for structured testing of core functionalities, user scenarios, and backward compatibility. New commands include `test-foundation`, `test-scenarios`, and `test-compatibility`, among others, to facilitate targeted testing. Additionally, the GitHub Actions workflow is updated to include dedicated jobs for foundation and scenario tests, improving CI/CD efficiency. Documentation is also added to guide users on utilizing the new testing framework effectively.
This commit introduces a comprehensive set of UML documentation for the ABSESpy library, including class and sequence diagrams for core, agents, space, and human modules, as well as user scenarios and internal flows. The `mkdocs.yml` configuration is updated to include new navigation entries for UML documentation, ensuring easy access. Additionally, JavaScript support for Mermaid diagrams is added to enhance visual representation. The `pyproject.toml` and `uv.lock` files are updated to include necessary dependencies for documentation generation. These changes aim to improve the clarity and accessibility of the project's architecture and usage patterns.
…y-style indexing This commit adds the __getitem__ method to the PatchModule class, enabling numpy-style indexing to access cells and return an ActorsList. The method supports various indexing patterns, including single cell, column, row, subregion, and full array selections. Comprehensive tests are introduced to validate the functionality and ensure correct behavior across different scenarios. Additionally, the ListRandom class is updated to enhance random generation capabilities, and the fire spread model is modified to utilize the new indexing features for improved tree placement and ignition operations.
… and colormap functionality This commit introduces a new test suite for the visualization utilities, including the `plot_raster` and `quick_plot` functions. The tests ensure proper visualization of spatial data from `PatchModule` instances, validating functionality with dictionary colormaps, custom titles, and save capabilities. Additionally, a new test for the `PlotableAttribute` class is added to verify dynamic attribute access and plotting methods. The `test_colormap.py` file is also created to demonstrate colormap functionality with enum-based states, enhancing the overall testing coverage for visualization features.
…tion This commit sets the environment variable LOGURU_AUTOINIT to "0" in the __init__.py file to disable loguru's default output. This change ensures that loguru does not add default handlers automatically, allowing users to configure logging explicitly through model settings. Additionally, the tutorial notebook is updated to remove unnecessary log output, enhancing clarity and focus on the model's functionality.
…thod in PatchModule This commit introduces a new `move_to` method in the `Actor` class, allowing actors to move to specified locations or randomly. Additionally, a `count_agents` method is added to the `PatchModule` class, enabling the counting of agents of a specific type across the module, with options for returning data as either a numpy array or an xarray DataArray. Both methods include comprehensive docstrings and typing annotations to enhance clarity and usability.
…mics This commit adds a new `config.yaml` file for the Wolf-Sheep model, allowing for customizable simulation parameters. Key enhancements in the model include increased energy levels for animals, improved reproduction mechanics, and the addition of properties to track sheep and wolf populations, as well as grass coverage. The README and quick start notebook are updated to reflect these changes, providing clearer instructions and showcasing the model's capabilities.
…guration and quick start notebook This commit deletes the obsolete `agents.py`, `analysis.ipynb`, and `README_EN.md` files, streamlining the project structure. A new `config.yaml` file is introduced to allow customizable simulation parameters for the Schelling model. Additionally, a `schelling_quick_start.ipynb` notebook is added, providing a beginner-friendly guide to running the model, complete with step-by-step instructions and visualizations. The model's dynamics are enhanced to improve agent behavior and data collection.
…nd modify pytest command This commit updates the `tox.ini` file to include the `skip_missing_interpreters` option, allowing for smoother environment setup. Additionally, the pytest command is modified to run using `python -m pytest`, ensuring compatibility and consistency across different environments.
…properties and methods This commit introduces several enhancements across the agents and space modules. In the `_AgentsContainer` class, a new `lst` property is added to retrieve the list of agents, improving attribute access. The `ActorsList` class now includes a `linked_agents` property to return agents based on list content, along with new properties `is_cells`, `is_actors`, and `is_mixed` to check the type of elements in the list. Additionally, the `PatchCell` class gains an `is_empty` property to determine if a cell has any agents. The `apply_agents` method in `PatchModule` is updated to support more flexible agent processing, including enhanced error handling and output options. Comprehensive tests for the `apply_agents` method are added to ensure robust functionality across various scenarios.
…th rollback functionality This commit introduces the `evaluate` method in the `Actor` class, allowing for the evaluation of candidates based on a scoring function. The method supports optional rollback of attributes and position, enhancing the flexibility of agent decision-making. Additionally, comprehensive tests for the `evaluate` method are added to ensure its correctness and robustness. The `Customer` and `Shop` classes in the Hotelling model are updated to utilize this new method, improving their functionality and performance. A new Jupyter notebook demonstrating the Hotelling model is also included, providing a quick start guide for users.
…ation structure This commit adds several new tutorials at the intermediate and advanced levels, including topics on containers and indexing, evaluation and decision-making, logging and configuration, and protocols and extensions. Additionally, the existing tutorials are reorganized to improve navigation and clarity. The `mkdocs.yml` file is updated to reflect these changes, ensuring that the new tutorials are properly categorized. The `pyproject.toml` and `uv.lock` files are also updated to include the `nbmake` dependency for enhanced notebook testing capabilities. A new `pytest.ini` file is introduced to configure pytest options for testing notebooks, further improving the project's testing framework.
…files This commit enhances the documentation structure by updating the `.gitignore` file to exclude auto-generated markdown files and Jupyter notebook checkpoints, while ensuring that manually written guides are tracked. The `mkdocs.yml` file is modified to reflect changes in the tutorial navigation, including the addition of new tutorials and the reorganization of existing ones. Furthermore, dependencies in `pyproject.toml` and `uv.lock` are updated to include `mkdocs-static-i18n` and `nbconvert`, improving the project's documentation and testing capabilities. Several obsolete tutorial notebooks are removed to streamline the content.
…configuration This commit deletes outdated documentation files, including Chinese translations and UML diagrams, to streamline the project structure. The `mkdocs.yml` file is updated to remove references to these deleted files, ensuring the documentation reflects the current state of the project. This cleanup enhances clarity and maintainability of the documentation resources.
This commit updates the Makefile to improve testing commands by adding new options for running Jupyter notebook tests and multi-version tests with tox. The `test-all` command is modified to include notebook tests, and new commands `test-notebooks`, `test-notebook`, and `test-all-notebooks` are introduced for better notebook testing management. Additionally, the installation of `nbmake` is included in the test tools setup, enhancing the project's testing capabilities.
…cumentation This commit updates the `.gitignore` file to exclude local environment files, ensuring sensitive information is not committed. The `pyproject.toml` file is modified to clarify the installation instructions for `mkdocs-material-insiders`, emphasizing that it should be installed locally via an environment variable. Additionally, the `uv.lock` file is updated to remove the direct reference to `mkdocs-material` and to reflect the latest version. The `index.md` file is also updated to reflect the new version of the documentation, enhancing clarity and maintainability.
|
Caution Review failedThe pull request is closed. WalkthroughThe PR introduces notebook conversion workflows, expands test infrastructure with layered testing, adds new Agent evaluation and linking methods, enhances PatchModule with indexing and spatial operations, introduces a plotting API for rasters, modernizes examples with updated patterns, and refreshes tutorials and documentation across the codebase. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (63)
Comment |
Summary by CodeRabbit
Release Notes
New Features
Documentation
Testing