diff --git a/CLAUDE.md b/CLAUDE.md index a918820cbb..c609eb442d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,531 +1,65 @@ -# CLAUDE.md +# Claude Agent Instructions -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +You are an automated contributor to the ResInsight repository. -## Build System +## Source of Truth -ResInsight uses CMake with multiple build generators supported. The project requires: -- CMake 3.26+ (boost dependency requirement) -- C++23 standard -- GCC 13+ or Clang 19+ (Linux) / MSVC 2022 17.8+ (Windows) -- Python 3.8+ -- Qt 6.4+ +You MUST follow the canonical agent guidelines located in the `docs/agents/` directory: -### Prerequisites and Dependencies +- **[docs/agents/core.md](docs/agents/core.md)** - Core agent guidelines, architecture overview, PDM system, Python integration +- **[docs/agents/build.md](docs/agents/build.md)** - Build system, prerequisites, test commands +- **[docs/agents/coding-style.md](docs/agents/coding-style.md)** - Code formatting, style conventions +- **[docs/agents/repo-map.md](docs/agents/repo-map.md)** - Repository structure and file locations -#### Linux (Ubuntu/Debian) +These documents contain the authoritative information about the project. Always consult them when working on code. -```bash -# Update system and install build tools -sudo apt update -sudo apt install build-essential curl zip unzip tar flex bison ninja-build +## Claude-Specific Rules -# Install Qt6 dependencies -sudo apt install qt6-base-dev qt6-base-private-dev qt6-charts-dev qt6-networkauth-dev libqt6svg6-dev +### Change Philosophy +- Prefer minimal diffs - make the smallest possible changes to achieve the goal +- Do not reformat unrelated code +- Preserve existing code style and comments +- Only modify files directly related to your task -# Clone repository and initialize submodules -git clone https://github.com/OPM/ResInsight -cd ResInsight -git submodule update --init +### Safety Guidelines +- Never modify CI/CD configuration unless explicitly asked +- Always validate changes don't break existing behavior +- Always validate changes don't introduce security vulnerabilities +- If unsure about a change, stop and explain the uncertainty to the user -# Bootstrap vcpkg for dependency management -ThirdParty/vcpkg/bootstrap-vcpkg.sh -``` +### Testing +- Run existing linters and tests before making changes +- Run linters and tests after making changes +- Do not add new testing tools unless necessary +- Do not remove or modify unrelated tests -#### Windows (Visual Studio 2022) +## Output Expectations -```powershell -# Install prerequisites: -# - Visual Studio 2022 (17.8+) with C++ workload and CMake tools -# - Qt 6.4+ (via Qt Online Installer or vcpkg) -# - Git for Windows -# - Python 3.8+ +### Before Making Changes +- Explain your reasoning and approach +- List the specific files that will be modified +- Describe the expected impact of the changes -# Clone repository and initialize submodules -git clone https://github.com/OPM/ResInsight -cd ResInsight -git submodule update --init +### When Making Changes +- Make incremental, focused changes +- Test each change before proceeding +- Report progress frequently using the `report_progress` tool -# Bootstrap vcpkg for dependency management -ThirdParty\vcpkg\bootstrap-vcpkg.bat -``` +### After Making Changes +- Verify the changes work as expected +- Run relevant tests and linters +- Document any issues or limitations discovered -### Build Commands +## Working with Python -#### Linux +When working with Python code: +- Always format code with `ruff format` +- Always check style with `ruff check --fix` +- Run these before committing changes -```bash -# Configure with CMake preset (recommended) -cmake . --preset=linux-base -# Note: Copy CMakeUserPresets-example-linux.json to CMakeUserPresets.json and update Qt paths +## Commit Messages -# OR configure manually -mkdir build && cd build -cmake .. -GNinja - -# Build the project -cd build && ninja -# OR from workspace root -ninja -C build - -# Build specific targets -ninja -C build ResInsight -ninja -C build extract-projectfile-versions -``` - -#### Windows (Visual Studio 2022) - -```powershell -# Configure with CMake preset (recommended) -cmake . --preset=x64-relwithdebinfo -# Note: Copy CMakeUserPresets-example-windows.json to CMakeUserPresets.json and update Qt paths - -# OR using Visual Studio 2022 CMake integration: -# 1. Open Visual Studio 2022 -# 2. File -> Open -> Folder -> Select ResInsight root directory -# 3. VS will automatically detect CMakeLists.txt and configure the project -# 4. Select x64-relwithdebinfo configuration from the dropdown -# 5. Build -> Build All - -# Build the project from command line -cmake --build --preset x64-relwithdebinfo - -# Build specific targets -cmake --build --preset x64-relwithdebinfo --target ResInsight -cmake --build --preset x64-relwithdebinfo --target extract-projectfile-versions -``` - -### Build Presets - -Available CMake presets in `CMakePresets.json`: -- `ninja`: Base configuration with vcpkg toolchain, unit tests enabled, warnings as errors -- `linux-base`: Inherits from ninja, includes Qt path configuration (Linux) -- `x64-release`: Release build configuration -- `x64-relwithdebinfo`: Release with debug info configuration (Windows) -- `x64-debug`: Debug build configuration (Windows) - -Create `CMakeUserPresets.json` from appropriate example file: -- Linux: Copy `CMakeUserPresets-example-linux.json` and update `CMAKE_PREFIX_PATH` for Qt installation -- Windows: Copy `CMakeUserPresets-example-windows.json` and update Qt paths, Python executable, and ODB API paths - -### Code Style and Formatting - -- **clang-format**: Configuration in `.clang-format` - -Use clang-format-19 to enforce style. - -### Test Commands - -The project uses CTest for testing: - -#### Linux - -```bash -# From build directory -ctest -# OR -ninja test - -# Run specific test suites -ctest -R "UnitTests" -ctest -R "opm-parser-tests" -ctest -R "roffcpp-tests" -ctest -R "regression-analysis-tests" -``` - -#### Windows - -```powershell -# From build directory -ctest -C RelWithDebInfo -# OR using CMake preset -cmake --build --preset x64-relwithdebinfo --target test - -# Run specific test suites -ctest -R "UnitTests" -C RelWithDebInfo -ctest -R "opm-parser-tests" -C RelWithDebInfo -ctest -R "roffcpp-tests" -C RelWithDebInfo -ctest -R "regression-analysis-tests" -C RelWithDebInfo -``` - -## Architecture Overview - -ResInsight is a 3D visualization and post-processing tool for reservoir simulation data built with a modular architecture: - -### Core Framework Structure - -- **Visualization Framework (Fwk/VizFwk/)**: Core 3D rendering using Qt/OpenGL - - LibCore, LibGeometry, LibRender, LibViewing, LibGuiQt - -- **Application Framework (Fwk/AppFwk/)**: UI and data management framework - - Project Data Model (PDM) system for serialization and UI generation - - Command framework for undo/redo operations - - User interface components built on Qt - -- **Application Code (ApplicationLibCode/)**: Domain-specific functionality - - Commands/, ResultStatisticsCache/, GeoMech/ modules - - Integration with Eclipse, ODB, and other reservoir simulation formats - -### Key Dependencies - -- **Qt6**: Application framework and UI (Core, Gui, OpenGL, Network, Widgets) -- **Third-party libraries**: resdata (ERT), OPM libraries, qwt plotting, OpenVDS seismic data -- **vcpkg**: Package manager for most dependencies - -### Data Sources Supported - -- Eclipse binary files (*.GRID, *.EGRID with *.INIT, *.XNNN, *.UNRST) -- ABAQUS ODB files (when RESINSIGHT_ODB_API_DIR is configured) -- OpenVDS seismic data -- Various well and completion data formats - -### Build Configuration Options - -Key CMake options: -- `RESINSIGHT_ENABLE_GRPC`: Enable gRPC scripting framework -- `RESINSIGHT_USE_ODB_API`: Enable ABAQUS ODB support -- `RESINSIGHT_ENABLE_UNITY_BUILD`: Experimental build speedup -- `RESINSIGHT_ENABLE_HDF5`: Enable HDF5 library support - -### Python Integration - -ResInsight includes Python integration via gRPC when `RESINSIGHT_ENABLE_GRPC=ON`: -- Python API modules in GrpcInterface/Python/ -- Two-way data exchange capabilities -- Script automation support - -### Python tests - -#### Linux - -```bash -# Make a virtual environment: -python3 -m venv venv-claude - -# Start the virtual env: -source venv-claude/bin/activate - -# Install pytest -pip install pytest - -# Run the tests (e.g all tests in tests_polygons.py): -cd GrpcInterface/Python/rips && source /workspace/venv-claude/bin/activate && RESINSIGHT_EXECUTABLE=build-claude/ResInsight python -m pytest tests/test_polygons.py --console -``` - -#### Windows - -```powershell -# Make a virtual environment: -python -m venv venv-claude - -# Start the virtual env: -venv-claude\Scripts\Activate.ps1 - -# Install pytest -pip install pytest - -# Run the tests (e.g all tests in tests_polygons.py): -cd GrpcInterface\Python\rips -$env:RESINSIGHT_EXECUTABLE="..\..\..\..\build\RelWithDebInfo\ResInsight.exe" -python -m pytest tests/test_polygons.py --console -``` - -### Python formatting and code style checks using ruff - -```bash -# Format source code -python -m ruff format test_polygons.py -# Check code style -python -m ruff check --fix test_polygons.py -``` - -### Making PDM Objects Scriptable for Python GRPC Interface - -To make a PDM (Project Data Model) object available in the Python GRPC interface, you need to make it "scriptable": - -#### 1. Convert PDM Object to Scriptable - -**In the header file (.h):** -- No changes needed to the class declaration -- The object inherits from `caf::PdmObject` as usual - -**In the source file (.cpp):** -```cpp -// Add required includes -#include "cafPdmFieldScriptingCapability.h" -#include "cafPdmObjectScriptingCapability.h" - -// Change object initialization -CAF_PDM_InitScriptableObject("Display Name", ":/Icon.png", "", "ScriptKeyword"); -``` - -#### 2. Convert PDM Fields to Scriptable - -**Change field initialization from:** -```cpp -CAF_PDM_InitField(&m_fieldName, "FieldName", defaultValue, "Display Name"); -``` - -**To:** -```cpp -CAF_PDM_InitScriptableField(&m_fieldName, "ScriptFieldName", defaultValue, "Display Name"); -``` - -#### 3. Field Naming Conventions for Python - -- Use camelCase for script field names (e.g., "StartMd", "EndMd") -- Python generator converts to snake_case automatically (start_md, end_md) -- Avoid abbreviations like "MD" - use "Md" instead - -#### 4. Class Keyword Requirements - -The class keyword used in `CAF_PDM_SOURCE_INIT` must be unique and descriptive: -```cpp -CAF_PDM_SOURCE_INIT(RimClassName, "ClassKeyword"); -``` - -#### 5. Build and Python Generation - -After making objects scriptable: -1. Build the project: `ninja -C build` -2. Python classes are automatically generated in `build/Python/rips/generated/generated_classes.py` -3. The scriptable class will appear as a Python class with appropriate attributes - -#### 6. GRPC Method Integration - -To add methods that return scriptable objects: -```cpp -// In GRPC interface method -QString RimcClassName_method::classKeywordReturnedType() const -{ - return RimTargetClass::classKeywordStatic(); -} -``` - -#### Example: DiameterRoughnessInterval - -**Before (not scriptable):** -```cpp -CAF_PDM_InitObject("Diameter Roughness Interval", ":/Icon.png"); -CAF_PDM_InitField(&m_startMD, "StartMD", 0.0, "Start MD"); -``` - -**After (scriptable):** -```cpp -CAF_PDM_InitScriptableObject("Diameter Roughness Interval", ":/Icon.png", "", "DiameterRoughnessInterval"); -CAF_PDM_InitScriptableField(&m_startMD, "StartMd", 0.0, "Start MD"); -``` - -This enables the class to be used from Python: -```python -interval = completions_settings.add_diameter_roughness_interval(start_md=100, end_md=200) -print(f"Start: {interval.start_md}, End: {interval.end_md}") -``` - -## Field Validation in Python GRPC Interface - -Python field updates are automatically validated when calling `obj.update()`. This ensures data integrity by preventing invalid values from being set. - -### Validation Types - -1. **Type Validation**: Ensures field value types match (int, float, string, etc.) - - Parsing errors are caught during type conversion - - Example: Setting a string "hello" to an integer field is rejected - -2. **Range Validation**: Checks values against min/max constraints defined with `setRange()`, `setMinValue()`, or `setMaxValue()` - - Fields with range constraints reject out-of-bounds values - - Example: A field with `setMinValue(0)` rejects negative values - -3. **Object Validation**: Validates cross-field constraints via `validate()` override - - Custom business logic can enforce relationships between fields - - Example: Ensuring end date is after start date - -### Setting Field Ranges in C++ - -To add range validation to a PDM field: - -```cpp -RimMyClass::RimMyClass() -{ - CAF_PDM_InitScriptableField(&m_percentage, "Percentage", 50.0, "Percentage"); - m_percentage.setRange(0.0, 100.0); // Validates 0-100 range - - CAF_PDM_InitScriptableField(&m_count, "Count", 1, "Count"); - m_count.setMinValue(0); // Only validates minimum - m_count.setMaxValue(100); // Only validates maximum - - CAF_PDM_InitScriptableField(&m_wellBoreFluidPvtTable, "WellBoreFluidPvtTable", 0, "Wellbore Fluid PVT Table"); - m_wellBoreFluidPvtTable.setMinValue(0); // Must be non-negative -} -``` - -### Python Behavior - -Invalid values are **rejected** and field values remain unchanged: - -```python -# Example: Setting invalid value -completions_settings = well_path.completion_settings() -completions_settings.well_bore_fluid_pvt_table = -5 # Invalid: below minimum of 0 - -try: - completions_settings.update() # Triggers validation -except Exception as e: - print(f"Validation failed: {e}") - # Output: - # Validation failed: <_InactiveRpcError of RPC that terminated with: - # status = StatusCode.INVALID_ARGUMENT - # details = "Validation failed for WellPathCompletionSettings: - # WellBoreFluidPvtTable: Value -5 is below minimum 0" - # > - -# The field retains its previous valid value (rollback occurred) -current_value = well_path.completion_settings().well_bore_fluid_pvt_table -print(f"Value remains: {current_value}") # Previous valid value -``` - -### Error Handling - -Validation errors raise gRPC exceptions with descriptive messages: - -```python -try: - obj.update() -except Exception as e: - error_msg = str(e) - if "Validation failed" in error_msg: - # Handle validation error - print("Please correct the following fields:") - print(error_msg) - else: - # Other error - raise -``` - -### Multiple Field Errors - -All validation errors are aggregated and returned together: - -```python -# Set multiple invalid values -settings.field1 = invalid_value1 -settings.field2 = invalid_value2 - -try: - settings.update() -except Exception as e: - # Error message lists all validation failures: - # "Validation failed for ClassName: - # field1: Value ... exceeds maximum ... - # field2: Value ... is below minimum ..." - pass -``` - -### Validation Guarantees - -- **Atomic Updates**: If any field fails validation, no fields are updated (all-or-nothing) -- **Rollback**: Failed updates don't modify field values - they remain at their previous valid state -- **Type Safety**: Cannot assign values of wrong type (string to int, etc.) -- **Clear Messages**: Error messages include field names and specific validation failures - -### Implementation Notes - -- Validation occurs automatically on `update()` - no manual validation needed -- Built on commit f342ca77572c840eadf22fe0a3fd2935c62fd04b validation infrastructure -- Uses C++23 `std::expected` for clean error handling -- Returns `grpc::INVALID_ARGUMENT` status with validation details - -## PDM UI Editor Attributes - Modern setAttribute Pattern - -Note: Always use () when accessing a field's value. This is required for proper type management. Use `m_myTextField()` instead of `m_myTextField`. - -The CAF (Command Application Framework) PDM (Project Data Model) system has migrated from the old `defineEditorAttribute` pattern to a modern `setAttribute` pattern using type-safe Keys structs. - -### New Pattern: setAttribute with Keys Struct - -**Setting attributes using the new pattern:** - -```cpp -// Modern approach - use Keys constants with implicit type deduction -m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::ADJUST_WIDTH_TO_CONTENTS, true ); -m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::MINIMUM_CONTENTS_LENGTH, 15 ); -m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::BUTTON_TEXT, "Click Me" ); -``` - -### Benefits of the New Pattern - -1. **Type Safety**: Compile-time checking of attribute names prevents typos -2. **IDE Support**: Auto-completion for attribute keys -3. **Self-Documenting**: Keys struct clearly shows available attributes for each editor -4. **Maintainable**: Single source of truth for attribute names -5. **Validation**: Automatic warnings for unsupported attributes - -### Migration from Old Pattern - -**Old pattern (deprecated):** -```cpp -// In defineEditorAttribute() override -auto* myAttr = dynamic_cast( attribute ); -if ( myAttr ) -{ - myAttr->adjustWidthToContents = true; - myAttr->minimumContentsLength = 15; -} -``` - -**New pattern:** -```cpp -// In field initialization or elsewhere -m_field.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::ADJUST_WIDTH_TO_CONTENTS, true ); -m_field.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::MINIMUM_CONTENTS_LENGTH, 15 ); -``` - -### Common Attribute Examples - -```cpp -// Line Editor - notify on text changes -m_textField.uiCapability()->setAttribute( caf::PdmUiLineEditor::Keys::NOTIFY_WHEN_TEXT_IS_EDITED, true ); - -// Label Editor - hyperlink with callback -m_labelField.uiCapability()->setAttribute( caf::PdmUiLabelEditor::Keys::LINK_TEXT, - "Click here" ); -std::function callback = [](const QString& link) { /* handler */ }; -m_labelField.uiCapability()->setAttribute( caf::PdmUiLabelEditor::Keys::LINK_ACTIVATED_CALLBACK, - QVariant::fromValue( callback ) ); - -// List Editor - set height hint -m_listField.uiCapability()->setAttribute( caf::PdmUiListEditor::Keys::HEIGHT_HINT, 150 ); - -// Push Button - set button text -m_buttonField.uiCapability()->setAttribute( caf::PdmUiPushButtonEditor::Keys::BUTTON_TEXT, "Execute" ); - -// Combo Box - enable previous/next buttons -m_comboField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::SHOW_PREVIOUS_AND_NEXT_BUTTONS, true ); -``` - -### Backward Compatibility - -The old `defineEditorAttribute` pattern still works but is discouraged for new code. Both patterns can coexist during migration, with the new `setAttribute` pattern taking precedence when both are used. - -## Development Notes - -- **Version**: Current version defined in `ResInsightVersion.cmake` (2025.04.4-dev) -- **Git Workflow**: Main development on `dev` branch, `master` branch for stable releases -- **Dependencies**: Extensive third-party integration via git submodules in `ThirdParty/` -- **Build Output**: Goes to `CMAKE_RUNTIME_OUTPUT_DIRECTORY` (CMAKE_CURRENT_BINARY_DIR) -- **Qt Integration**: Uses Qt's resource system (.qrc files) for UI resources -- **Entry Point**: Main executable and supporting tools built from `ApplicationExeCode/` -- **Testing**: Cross-platform automated testing on RHEL, Ubuntu, and Windows 11 -- **Build Configuration**: Key option `RESINSIGHT_TREAT_WARNINGS_AS_ERRORS` available in CMake presets - -## Common File Locations - -- Main CMake configuration: `/workspace/CMakeLists.txt` -- Application entry point: `ApplicationExeCode/RiaMain.cpp` -- Version info: `ResInsightVersion.cmake` -- Third-party dependencies: `ThirdParty/` with individual CMakeLists.txt files -- Python API: `GrpcInterface/Python/` - -- When creating a git commit for a feature request use the issue number at the start of the title, e.g "#12773 Python: Add API for creating valve templates" -- When creating a commit use git conventions. Skip attributing claude-code as author (although you were helpful). -- Always run python formatting/check on changed files before commits. \ No newline at end of file +Follow these conventions: +- Start with issue number: `#12773 Python: Add API for creating valve templates` +- Use standard git commit message format +- Keep first line concise and descriptive \ No newline at end of file diff --git a/README.md b/README.md index b7a7998c78..60fcc3ba52 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Most dependencies are managed using vcpkg as defined in [vcpkg.json](https://git Contributions are welcome! Please: - Use the `dev` branch for contributions and pull requests - Note that the `master` branch is kept stable and updated only for releases -- See [Spell Checking Guide](doc/spell-checking.md) for information on automated spell checking +- See [Spell Checking Guide](docs/spell-checking.md) for information on automated spell checking ### Building See the [Build Instructions](https://resinsight.org/releases/build-from-source/build-instructions-ubuntu/) for detailed setup information. diff --git a/copilot-instructions.md b/copilot-instructions.md new file mode 100644 index 0000000000..e4b52f2c9f --- /dev/null +++ b/copilot-instructions.md @@ -0,0 +1,81 @@ +# GitHub Copilot Instructions + +You are an AI pair programming assistant helping developers work on the ResInsight codebase. + +## Source of Truth + +You MUST follow the canonical agent guidelines located in the `docs/agents/` directory: + +- **[docs/agents/core.md](docs/agents/core.md)** - Core agent guidelines, architecture overview, PDM system, Python integration +- **[docs/agents/coding-style.md](docs/agents/coding-style.md)** - Code formatting, style conventions +- **[docs/agents/repo-map.md](docs/agents/repo-map.md)** - Repository structure and file locations + +These documents contain the authoritative information about the project. Always consult them when making suggestions. + +- When working locally, the build description can be found in `docs/agents/build.md`. NEVER build when working in the cloud. + +## Copilot-Specific Guidelines + +### Code Suggestions +- Suggest minimal, focused changes that solve the immediate problem +- Match the existing code style and patterns in the file +- Use modern C++23 features where appropriate +- Follow the PDM pattern for ResInsight-specific code + +### Code Completion +- Complete code based on surrounding context +- Use existing class patterns and naming conventions +- Follow the clang-format style defined in `.clang-format` +- For Python code, follow PEP 8 and use snake_case + +### Best Practices +1. **Understand Context**: Read nearby code to understand patterns and conventions +2. **Minimal Changes**: Suggest the smallest change that accomplishes the goal +3. **Type Safety**: Leverage C++23 type system and avoid implicit conversions +4. **Error Handling**: Use `std::expected` or appropriate error handling patterns +5. **Testing**: Suggest test cases when appropriate + +### Language-Specific Guidelines + +#### C++ +- Use C++23 standard library features +- Follow RAII principles +- Use smart pointers (`std::unique_ptr`, `std::shared_ptr`) appropriately +- Prefer `auto` for complex types, but be explicit when clarity matters +- Use `const` and `constexpr` liberally + +#### Python +- Format with `ruff format` +- Check style with `ruff check` +- Use type hints where helpful +- Follow snake_case naming convention +- Keep code compatible with Python 3.8+ + +## When to Stop and Ask + +If you encounter any of these situations, stop and ask the developer: +- Unclear requirements or specifications +- Changes that would affect multiple subsystems +- Breaking changes to public APIs +- Security-sensitive code modifications +- Performance-critical code sections + +## Testing Reminders + +- Run `ninja -C build` to build after C++ changes +- Run `ctest` to run tests +- For Python: Run `ruff format` and `ruff check --fix` before committing +- Test Python API changes with pytest: `python -m pytest tests/test_*.py` + +## Git Commit Message Format + +When suggesting commit messages: +``` +#12773 Python: Add API for creating valve templates + +- Added RimcWellPath_addValveTemplate method +- Made RimValveTemplate scriptable +- Updated Python tests +``` + +Start with issue number, followed by a brief description, then bullet points for details. diff --git a/docs/agents/build.md b/docs/agents/build.md new file mode 100644 index 0000000000..5ae93932ca --- /dev/null +++ b/docs/agents/build.md @@ -0,0 +1,175 @@ +# Build System Documentation + +ResInsight uses CMake with multiple build generators supported. The project requires: +- CMake 3.26+ (boost dependency requirement) +- C++23 standard +- GCC 13+ or Clang 19+ (Linux) / MSVC 2022 17.8+ (Windows) +- Python 3.8+ +- Qt 6.4+ + +## Prerequisites and Dependencies + +### Linux (Ubuntu/Debian) + +```bash +# Update system and install build tools +sudo apt update +sudo apt install build-essential curl zip unzip tar flex bison ninja-build + +# Install Qt6 dependencies +sudo apt install qt6-base-dev qt6-base-private-dev qt6-charts-dev qt6-networkauth-dev libqt6svg6-dev + +# Clone repository and initialize submodules +git clone https://github.com/OPM/ResInsight +cd ResInsight +git submodule update --init + +# Bootstrap vcpkg for dependency management +ThirdParty/vcpkg/bootstrap-vcpkg.sh +``` + +### Windows (Visual Studio 2022) + +```powershell +# Install prerequisites: +# - Visual Studio 2022 (17.8+) with C++ workload and CMake tools +# - Qt 6.4+ (via Qt Online Installer or vcpkg) +# - Git for Windows +# - Python 3.8+ + +# Clone repository and initialize submodules +git clone https://github.com/OPM/ResInsight +cd ResInsight +git submodule update --init + +# Bootstrap vcpkg for dependency management +ThirdParty\vcpkg\bootstrap-vcpkg.bat +``` + +## Build Commands + +### Linux + +```bash +# Configure with CMake preset (recommended) +cmake . --preset=linux-base +# Note: Copy CMakeUserPresets-example-linux.json to CMakeUserPresets.json and update Qt paths + +# OR configure manually +mkdir build && cd build +cmake .. -GNinja + +# Build the project +cd build && ninja +# OR from workspace root +ninja -C build + +# Build specific targets +ninja -C build ResInsight +ninja -C build extract-projectfile-versions +``` + +### Windows (Visual Studio 2022) + +```powershell +# Configure with CMake preset (recommended) +cmake . --preset=x64-relwithdebinfo +# Note: Copy CMakeUserPresets-example-windows.json to CMakeUserPresets.json and update Qt paths + +# OR using Visual Studio 2022 CMake integration: +# 1. Open Visual Studio 2022 +# 2. File -> Open -> Folder -> Select ResInsight root directory +# 3. VS will automatically detect CMakeLists.txt and configure the project +# 4. Select x64-relwithdebinfo configuration from the dropdown +# 5. Build -> Build All + +# Build the project from command line +cmake --build --preset x64-relwithdebinfo + +# Build specific targets +cmake --build --preset x64-relwithdebinfo --target ResInsight +cmake --build --preset x64-relwithdebinfo --target extract-projectfile-versions +``` + +## Build Presets + +Available CMake presets in `CMakePresets.json`: +- `ninja`: Base configuration with vcpkg toolchain, unit tests enabled, warnings as errors +- `linux-base`: Inherits from ninja, includes Qt path configuration (Linux) +- `x64-release`: Release build configuration +- `x64-relwithdebinfo`: Release with debug info configuration (Windows) +- `x64-debug`: Debug build configuration (Windows) + +Create `CMakeUserPresets.json` from appropriate example file: +- Linux: Copy `CMakeUserPresets-example-linux.json` and update `CMAKE_PREFIX_PATH` for Qt installation +- Windows: Copy `CMakeUserPresets-example-windows.json` and update Qt paths, Python executable, and ODB API paths + +## Test Commands + +The project uses CTest for testing: + +### Linux + +```bash +# From build directory +ctest +# OR +ninja test + +# Run specific test suites +ctest -R "UnitTests" +ctest -R "opm-parser-tests" +ctest -R "roffcpp-tests" +ctest -R "regression-analysis-tests" +``` + +### Windows + +```powershell +# From build directory +ctest -C RelWithDebInfo +# OR using CMake preset +cmake --build --preset x64-relwithdebinfo --target test + +# Run specific test suites +ctest -R "UnitTests" -C RelWithDebInfo +ctest -R "opm-parser-tests" -C RelWithDebInfo +ctest -R "roffcpp-tests" -C RelWithDebInfo +ctest -R "regression-analysis-tests" -C RelWithDebInfo +``` + +## Python Tests + +### Linux + +```bash +# Make a virtual environment: +python3 -m venv venv-claude + +# Start the virtual env: +source venv-claude/bin/activate + +# Install pytest +pip install pytest + +# Run the tests (e.g all tests in tests_polygons.py): +cd GrpcInterface/Python/rips && source /workspace/venv-claude/bin/activate && RESINSIGHT_EXECUTABLE=build-claude/ResInsight python -m pytest tests/test_polygons.py --console +``` + +### Windows + +```powershell +# Make a virtual environment: +python -m venv venv-claude + +# Start the virtual env: +venv-claude\Scripts\Activate.ps1 + +# Install pytest +pip install pytest + +# Run the tests (e.g all tests in tests_polygons.py): +cd GrpcInterface\Python\rips +$env:RESINSIGHT_EXECUTABLE="..\..\..\..\build\RelWithDebInfo\ResInsight.exe" +python -m pytest tests/test_polygons.py --console +``` diff --git a/docs/agents/coding-style.md b/docs/agents/coding-style.md new file mode 100644 index 0000000000..9b8c0dd88a --- /dev/null +++ b/docs/agents/coding-style.md @@ -0,0 +1,59 @@ +# Coding Style Guidelines + +This document describes the coding style and formatting conventions for ResInsight. + +## Code Formatting + +### clang-format + +ResInsight uses clang-format for C++ code formatting: +- **Configuration**: `.clang-format` file in repository root +- **Version**: Use clang-format-19 to enforce style + +### Python Formatting + +Python code should be formatted using `ruff`: + +```bash +# Format source code +python -m ruff format test_polygons.py + +# Check code style +python -m ruff check --fix test_polygons.py +``` + +## Language Standards + +- **C++**: C++23 standard +- **Python**: Python 3.8+ + +## Best Practices + +### General Guidelines + +1. **Minimal Changes**: Make the smallest possible changes to achieve the goal +2. **Preserve Formatting**: Do not reformat unrelated code +3. **Comments**: Match the style of existing comments in the file +4. **Libraries**: Use existing libraries whenever possible; only add new libraries or update versions if absolutely necessary + +### Code Quality + +1. Always validate changes don't break existing behavior +2. Always validate changes don't introduce security vulnerabilities +3. Fix any vulnerabilities related to your changes +4. Run linters, builds and tests before making code changes to understand any existing issues +5. Always try to lint, build and test code changes as soon as possible after making them + +### Testing + +1. Only run linters, builds and tests that already exist +2. Do not add new linting, building or testing tools unless necessary to fix the issue +3. It is unacceptable to remove or edit unrelated tests +4. Documentation changes do not need to be linted, built or tested unless there are specific tests for documentation + +## Commit Conventions + +When creating commits: +- Use issue number at the start of the title: `#12773 Python: Add API for creating valve templates` +- Follow git conventions for commit messages +- Always run python formatting/check on changed files before commits diff --git a/docs/agents/core.md b/docs/agents/core.md new file mode 100644 index 0000000000..db697661a9 --- /dev/null +++ b/docs/agents/core.md @@ -0,0 +1,344 @@ +# Core Agent Guidelines + +This document provides core guidelines that all AI agents working on ResInsight should follow. + +## Project Overview + +ResInsight is a 3D visualization and post-processing tool for reservoir simulation data built with a modular architecture. + +## Architecture Overview + +### Core Framework Structure + +- **Visualization Framework (Fwk/VizFwk/)**: Core 3D rendering using Qt/OpenGL + - LibCore, LibGeometry, LibRender, LibViewing, LibGuiQt + +- **Application Framework (Fwk/AppFwk/)**: UI and data management framework + - Project Data Model (PDM) system for serialization and UI generation + - Command framework for undo/redo operations + - User interface components built on Qt + +- **Application Code (ApplicationLibCode/)**: Domain-specific functionality + - Commands/, ResultStatisticsCache/, GeoMech/ modules + - Integration with Eclipse, ODB, and other reservoir simulation formats + +### Key Dependencies + +- **Qt6**: Application framework and UI (Core, Gui, OpenGL, Network, Widgets) +- **Third-party libraries**: resdata (ERT), OPM libraries, qwt plotting, OpenVDS seismic data +- **vcpkg**: Package manager for most dependencies + +### Data Sources Supported + +- Eclipse binary files (*.GRID, *.EGRID with *.INIT, *.XNNN, *.UNRST) +- ABAQUS ODB files (when RESINSIGHT_ODB_API_DIR is configured) +- OpenVDS seismic data +- Various well and completion data formats + +### Build Configuration Options + +Key CMake options: +- `RESINSIGHT_ENABLE_GRPC`: Enable gRPC scripting framework +- `RESINSIGHT_USE_ODB_API`: Enable ABAQUS ODB support +- `RESINSIGHT_ENABLE_UNITY_BUILD`: Experimental build speedup +- `RESINSIGHT_ENABLE_HDF5`: Enable HDF5 library support + +### Python Integration + +ResInsight includes Python integration via gRPC when `RESINSIGHT_ENABLE_GRPC=ON`: +- Python API modules in GrpcInterface/Python/ +- Two-way data exchange capabilities +- Script automation support + +## Development Notes + +- **Version**: Current version defined in `ResInsightVersion.cmake` (2025.04.4-dev) +- **Git Workflow**: Main development on `dev` branch, `master` branch for stable releases +- **Dependencies**: Extensive third-party integration via git submodules in `ThirdParty/` +- **Build Output**: Goes to `CMAKE_RUNTIME_OUTPUT_DIRECTORY` (CMAKE_CURRENT_BINARY_DIR) +- **Qt Integration**: Uses Qt's resource system (.qrc files) for UI resources +- **Entry Point**: Main executable and supporting tools built from `ApplicationExeCode/` +- **Testing**: Cross-platform automated testing on RHEL, Ubuntu, and Windows 11 +- **Build Configuration**: Key option `RESINSIGHT_TREAT_WARNINGS_AS_ERRORS` available in CMake presets + +## Common File Locations + +- Main CMake configuration: `/workspace/CMakeLists.txt` +- Application entry point: `ApplicationExeCode/RiaMain.cpp` +- Version info: `ResInsightVersion.cmake` +- Third-party dependencies: `ThirdParty/` with individual CMakeLists.txt files +- Python API: `GrpcInterface/Python/` + +## Git Commit Conventions + +- When creating a git commit for a feature request use the issue number at the start of the title, e.g "#12773 Python: Add API for creating valve templates" +- When creating a commit use git conventions +- Always run python formatting/check on changed files before commits + +## Making PDM Objects Scriptable for Python GRPC Interface + +To make a PDM (Project Data Model) object available in the Python GRPC interface, you need to make it "scriptable": + +### 1. Convert PDM Object to Scriptable + +**In the header file (.h):** +- No changes needed to the class declaration +- The object inherits from `caf::PdmObject` as usual + +**In the source file (.cpp):** +```cpp +// Add required includes +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +// Change object initialization +CAF_PDM_InitScriptableObject("Display Name", ":/Icon.png", "", "ScriptKeyword"); +``` + +### 2. Convert PDM Fields to Scriptable + +**Change field initialization from:** +```cpp +CAF_PDM_InitField(&m_fieldName, "FieldName", defaultValue, "Display Name"); +``` + +**To:** +```cpp +CAF_PDM_InitScriptableField(&m_fieldName, "ScriptFieldName", defaultValue, "Display Name"); +``` + +### 3. Field Naming Conventions for Python + +- Use camelCase for script field names (e.g., "StartMd", "EndMd") +- Python generator converts to snake_case automatically (start_md, end_md) +- Avoid abbreviations like "MD" - use "Md" instead + +### 4. Class Keyword Requirements + +The class keyword used in `CAF_PDM_SOURCE_INIT` must be unique and descriptive: +```cpp +CAF_PDM_SOURCE_INIT(RimClassName, "ClassKeyword"); +``` + +### 5. Build and Python Generation + +After making objects scriptable: +1. Build the project: `ninja -C build` +2. Python classes are automatically generated in `build/Python/rips/generated/generated_classes.py` +3. The scriptable class will appear as a Python class with appropriate attributes + +### 6. GRPC Method Integration + +To add methods that return scriptable objects: +```cpp +// In GRPC interface method +QString RimcClassName_method::classKeywordReturnedType() const +{ + return RimTargetClass::classKeywordStatic(); +} +``` + +### Example: DiameterRoughnessInterval + +**Before (not scriptable):** +```cpp +CAF_PDM_InitObject("Diameter Roughness Interval", ":/Icon.png"); +CAF_PDM_InitField(&m_startMD, "StartMD", 0.0, "Start MD"); +``` + +**After (scriptable):** +```cpp +CAF_PDM_InitScriptableObject("Diameter Roughness Interval", ":/Icon.png", "", "DiameterRoughnessInterval"); +CAF_PDM_InitScriptableField(&m_startMD, "StartMd", 0.0, "Start MD"); +``` + +This enables the class to be used from Python: +```python +interval = completions_settings.add_diameter_roughness_interval(start_md=100, end_md=200) +print(f"Start: {interval.start_md}, End: {interval.end_md}") +``` + +## Field Validation in Python GRPC Interface + +Python field updates are automatically validated when calling `obj.update()`. This ensures data integrity by preventing invalid values from being set. + +### Validation Types + +1. **Type Validation**: Ensures field value types match (int, float, string, etc.) + - Parsing errors are caught during type conversion + - Example: Setting a string "hello" to an integer field is rejected + +2. **Range Validation**: Checks values against min/max constraints defined with `setRange()`, `setMinValue()`, or `setMaxValue()` + - Fields with range constraints reject out-of-bounds values + - Example: A field with `setMinValue(0)` rejects negative values + +3. **Object Validation**: Validates cross-field constraints via `validate()` override + - Custom business logic can enforce relationships between fields + - Example: Ensuring end date is after start date + +### Setting Field Ranges in C++ + +To add range validation to a PDM field: + +```cpp +RimMyClass::RimMyClass() +{ + CAF_PDM_InitScriptableField(&m_percentage, "Percentage", 50.0, "Percentage"); + m_percentage.setRange(0.0, 100.0); // Validates 0-100 range + + CAF_PDM_InitScriptableField(&m_count, "Count", 1, "Count"); + m_count.setMinValue(0); // Only validates minimum + m_count.setMaxValue(100); // Only validates maximum + + CAF_PDM_InitScriptableField(&m_wellBoreFluidPvtTable, "WellBoreFluidPvtTable", 0, "Wellbore Fluid PVT Table"); + m_wellBoreFluidPvtTable.setMinValue(0); // Must be non-negative +} +``` + +### Python Behavior + +Invalid values are **rejected** and field values remain unchanged: + +```python +# Example: Setting invalid value +completions_settings = well_path.completion_settings() +completions_settings.well_bore_fluid_pvt_table = -5 # Invalid: below minimum of 0 + +try: + completions_settings.update() # Triggers validation +except Exception as e: + print(f"Validation failed: {e}") + # Output: + # Validation failed: <_InactiveRpcError of RPC that terminated with: + # status = StatusCode.INVALID_ARGUMENT + # details = "Validation failed for WellPathCompletionSettings: + # WellBoreFluidPvtTable: Value -5 is below minimum 0" + # > + +# The field retains its previous valid value (rollback occurred) +current_value = well_path.completion_settings().well_bore_fluid_pvt_table +print(f"Value remains: {current_value}") # Previous valid value +``` + +### Error Handling + +Validation errors raise gRPC exceptions with descriptive messages: + +```python +try: + obj.update() +except Exception as e: + error_msg = str(e) + if "Validation failed" in error_msg: + # Handle validation error + print("Please correct the following fields:") + print(error_msg) + else: + # Other error + raise +``` + +### Multiple Field Errors + +All validation errors are aggregated and returned together: + +```python +# Set multiple invalid values +settings.field1 = invalid_value1 +settings.field2 = invalid_value2 + +try: + settings.update() +except Exception as e: + # Error message lists all validation failures: + # "Validation failed for ClassName: + # field1: Value ... exceeds maximum ... + # field2: Value ... is below minimum ..." + pass +``` + +### Validation Guarantees + +- **Atomic Updates**: If any field fails validation, no fields are updated (all-or-nothing) +- **Rollback**: Failed updates don't modify field values - they remain at their previous valid state +- **Type Safety**: Cannot assign values of wrong type (string to int, etc.) +- **Clear Messages**: Error messages include field names and specific validation failures + +### Implementation Notes + +- Validation occurs automatically on `update()` - no manual validation needed +- Built on commit f342ca77572c840eadf22fe0a3fd2935c62fd04b validation infrastructure +- Uses C++23 `std::expected` for clean error handling +- Returns `grpc::INVALID_ARGUMENT` status with validation details + +## PDM UI Editor Attributes - Modern setAttribute Pattern + +Note: Always use () when accessing a field's value. This is required for proper type management. Use `m_myTextField()` instead of `m_myTextField`. + +The CAF (Command Application Framework) PDM (Project Data Model) system has migrated from the old `defineEditorAttribute` pattern to a modern `setAttribute` pattern using type-safe Keys structs. + +### New Pattern: setAttribute with Keys Struct + +**Setting attributes using the new pattern:** + +```cpp +// Modern approach - use Keys constants with implicit type deduction +m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::ADJUST_WIDTH_TO_CONTENTS, true ); +m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::MINIMUM_CONTENTS_LENGTH, 15 ); +m_comboBoxField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::BUTTON_TEXT, "Click Me" ); +``` + +### Benefits of the New Pattern + +1. **Type Safety**: Compile-time checking of attribute names prevents typos +2. **IDE Support**: Auto-completion for attribute keys +3. **Self-Documenting**: Keys struct clearly shows available attributes for each editor +4. **Maintainable**: Single source of truth for attribute names +5. **Validation**: Automatic warnings for unsupported attributes + +### Migration from Old Pattern + +**Old pattern (deprecated):** +```cpp +// In defineEditorAttribute() override +auto* myAttr = dynamic_cast( attribute ); +if ( myAttr ) +{ + myAttr->adjustWidthToContents = true; + myAttr->minimumContentsLength = 15; +} +``` + +**New pattern:** +```cpp +// In field initialization or elsewhere +m_field.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::ADJUST_WIDTH_TO_CONTENTS, true ); +m_field.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::MINIMUM_CONTENTS_LENGTH, 15 ); +``` + +### Common Attribute Examples + +```cpp +// Line Editor - notify on text changes +m_textField.uiCapability()->setAttribute( caf::PdmUiLineEditor::Keys::NOTIFY_WHEN_TEXT_IS_EDITED, true ); + +// Label Editor - hyperlink with callback +m_labelField.uiCapability()->setAttribute( caf::PdmUiLabelEditor::Keys::LINK_TEXT, + "Click here" ); +std::function callback = [](const QString& link) { /* handler */ }; +m_labelField.uiCapability()->setAttribute( caf::PdmUiLabelEditor::Keys::LINK_ACTIVATED_CALLBACK, + QVariant::fromValue( callback ) ); + +// List Editor - set height hint +m_listField.uiCapability()->setAttribute( caf::PdmUiListEditor::Keys::HEIGHT_HINT, 150 ); + +// Push Button - set button text +m_buttonField.uiCapability()->setAttribute( caf::PdmUiPushButtonEditor::Keys::BUTTON_TEXT, "Execute" ); + +// Combo Box - enable previous/next buttons +m_comboField.uiCapability()->setAttribute( caf::PdmUiComboBoxEditor::Keys::SHOW_PREVIOUS_AND_NEXT_BUTTONS, true ); +``` + +### Backward Compatibility + +The old `defineEditorAttribute` pattern still works but is discouraged for new code. Both patterns can coexist during migration, with the new `setAttribute` pattern taking precedence when both are used. diff --git a/docs/agents/repo-map.md b/docs/agents/repo-map.md new file mode 100644 index 0000000000..4eed99b0e6 --- /dev/null +++ b/docs/agents/repo-map.md @@ -0,0 +1,122 @@ +# Repository Map + +This document provides an overview of the ResInsight repository structure and key file locations. + +## Top-Level Directory Structure + +``` +ResInsight/ +├── ApplicationExeCode/ # Main executable entry points +│ └── RiaMain.cpp # Application entry point +├── ApplicationLibCode/ # Domain-specific functionality +│ ├── Commands/ # Command framework implementations +│ ├── ResultStatisticsCache/ +│ └── GeoMech/ # Geomechanics modules +├── Fwk/ # Framework libraries +│ ├── VizFwk/ # Visualization framework (Qt/OpenGL) +│ │ ├── LibCore +│ │ ├── LibGeometry +│ │ ├── LibRender +│ │ ├── LibViewing +│ │ └── LibGuiQt +│ └── AppFwk/ # Application framework +│ ├── PDM system # Project Data Model for serialization +│ ├── Command framework # Undo/redo operations +│ └── UI components # Qt-based user interface +├── GrpcInterface/ # gRPC integration +│ └── Python/ # Python API +│ └── rips/ # Python package +├── ThirdParty/ # Third-party dependencies (git submodules) +│ └── vcpkg/ # vcpkg package manager +├── TestModels/ # Test data and models +├── cmake/ # CMake modules and utilities +├── docs/ # Documentation +│ ├── agents/ # Agent-specific documentation +│ └── class-diagrams/ # PlantUML class diagrams +├── scripts/ # Build and utility scripts +├── tooling/ # Development tools +├── patches/ # Patches for dependencies +├── CMakeLists.txt # Main CMake configuration +├── CMakePresets.json # CMake build presets +├── ResInsightVersion.cmake # Version information +└── vcpkg.json # vcpkg dependencies +``` + +## Key Files + +### Build Configuration +- `CMakeLists.txt` - Main CMake configuration +- `CMakePresets.json` - Predefined build configurations +- `CMakeUserPresets-example-linux.json` - Example user presets for Linux +- `CMakeUserPresets-example-windows.json` - Example user presets for Windows +- `vcpkg.json` - vcpkg dependency manifest +- `vcpkg-configuration.json` - vcpkg configuration + +### Version and Documentation +- `ResInsightVersion.cmake` - Version definitions (2025.04.4-dev) +- `README.md` - Project overview and getting started +- `COPYING` - License information +- `docs/agents/` - Agent documentation + - `core.md` - Core agent guidelines + - `build.md` - Build system documentation + - `coding-style.md` - Coding style guidelines + - `repo-map.md` - This file + +### Code Formatting +- `.clang-format` - clang-format configuration for C++ code +- `.codespellrc` - codespell configuration +- `.codespell-ignore` - codespell ignore list +- `.misspell-fixer.ignore` - misspell-fixer ignore list + +### Source Code Organization + +#### Visualization Framework (Fwk/VizFwk/) +Core 3D rendering using Qt/OpenGL with libraries for: +- Geometry processing +- Rendering pipeline +- View management +- Qt GUI integration + +#### Application Framework (Fwk/AppFwk/) +- **PDM System**: Project Data Model for: + - Object serialization + - UI generation + - Field validation +- **Command Framework**: Undo/redo operations +- **UI Components**: Qt-based widgets and dialogs + +#### Application Code (ApplicationLibCode/) +Domain-specific functionality including: +- Eclipse file format integration +- ODB (ABAQUS) support +- Well path and completion management +- Grid and geometry processing +- Result statistics and caching + +#### Python Integration (GrpcInterface/Python/) +- gRPC server implementation +- Python API (rips package) +- Generated Python classes from PDM objects +- Test suite for Python API + +## Data File Formats + +ResInsight supports various reservoir simulation file formats: +- Eclipse binary: `*.GRID`, `*.EGRID`, `*.INIT`, `*.XNNN`, `*.UNRST` +- ABAQUS ODB files (when `RESINSIGHT_ODB_API_DIR` configured) +- OpenVDS seismic data +- Well and completion data formats + +## Build Outputs + +Build artifacts are placed in: +- Linux: `build/` directory (or preset-specific directory) +- Windows: `build/RelWithDebInfo/`, `build/Debug/`, etc. +- Python generated classes: `build/Python/rips/generated/generated_classes.py` + +## Testing + +- Unit tests: Various test executables +- Integration tests: CTest-based test suites +- Python tests: `GrpcInterface/Python/rips/tests/` +- Test data: `TestModels/` directory diff --git a/doc/ResInsightHeadlessSnapshots.txt b/docs/class-diagrams/ResInsightHeadlessSnapshots.txt similarity index 100% rename from doc/ResInsightHeadlessSnapshots.txt rename to docs/class-diagrams/ResInsightHeadlessSnapshots.txt diff --git a/doc/annotations.plantuml b/docs/class-diagrams/annotations.plantuml similarity index 100% rename from doc/annotations.plantuml rename to docs/class-diagrams/annotations.plantuml diff --git a/doc/case_collections.plantuml b/docs/class-diagrams/case_collections.plantuml similarity index 100% rename from doc/case_collections.plantuml rename to docs/class-diagrams/case_collections.plantuml diff --git a/doc/cell_filter_classes.plantuml b/docs/class-diagrams/cell_filter_classes.plantuml similarity index 100% rename from doc/cell_filter_classes.plantuml rename to docs/class-diagrams/cell_filter_classes.plantuml diff --git a/doc/command_file.plantuml b/docs/class-diagrams/command_file.plantuml similarity index 100% rename from doc/command_file.plantuml rename to docs/class-diagrams/command_file.plantuml diff --git a/doc/curve_creator.plantuml b/docs/class-diagrams/curve_creator.plantuml similarity index 100% rename from doc/curve_creator.plantuml rename to docs/class-diagrams/curve_creator.plantuml diff --git a/doc/eclipse_binary_file_classes.plantuml b/docs/class-diagrams/eclipse_binary_file_classes.plantuml similarity index 100% rename from doc/eclipse_binary_file_classes.plantuml rename to docs/class-diagrams/eclipse_binary_file_classes.plantuml diff --git a/doc/fracture_clases.plantuml b/docs/class-diagrams/fracture_clases.plantuml similarity index 100% rename from doc/fracture_clases.plantuml rename to docs/class-diagrams/fracture_clases.plantuml diff --git a/doc/graph_classes.plantuml b/docs/class-diagrams/graph_classes.plantuml similarity index 100% rename from doc/graph_classes.plantuml rename to docs/class-diagrams/graph_classes.plantuml diff --git a/doc/grpc_sequence.plantuml b/docs/class-diagrams/grpc_sequence.plantuml similarity index 100% rename from doc/grpc_sequence.plantuml rename to docs/class-diagrams/grpc_sequence.plantuml diff --git a/doc/grpc_server.plantuml b/docs/class-diagrams/grpc_server.plantuml similarity index 100% rename from doc/grpc_server.plantuml rename to docs/class-diagrams/grpc_server.plantuml diff --git a/doc/identify-missing-copyright.txt b/docs/class-diagrams/identify-missing-copyright.txt similarity index 100% rename from doc/identify-missing-copyright.txt rename to docs/class-diagrams/identify-missing-copyright.txt diff --git a/doc/legends.plantuml b/docs/class-diagrams/legends.plantuml similarity index 100% rename from doc/legends.plantuml rename to docs/class-diagrams/legends.plantuml diff --git a/doc/nnc_data.plantuml b/docs/class-diagrams/nnc_data.plantuml similarity index 100% rename from doc/nnc_data.plantuml rename to docs/class-diagrams/nnc_data.plantuml diff --git a/doc/pdm_call_sequence.plantuml b/docs/class-diagrams/pdm_call_sequence.plantuml similarity index 100% rename from doc/pdm_call_sequence.plantuml rename to docs/class-diagrams/pdm_call_sequence.plantuml diff --git a/doc/pick_events.plantuml b/docs/class-diagrams/pick_events.plantuml similarity index 100% rename from doc/pick_events.plantuml rename to docs/class-diagrams/pick_events.plantuml diff --git a/doc/qwtplot.plantuml b/docs/class-diagrams/qwtplot.plantuml similarity index 100% rename from doc/qwtplot.plantuml rename to docs/class-diagrams/qwtplot.plantuml diff --git a/doc/rim_rig_relationships.plantuml b/docs/class-diagrams/rim_rig_relationships.plantuml similarity index 100% rename from doc/rim_rig_relationships.plantuml rename to docs/class-diagrams/rim_rig_relationships.plantuml diff --git a/doc/summary_cases_and_readers.plantuml b/docs/class-diagrams/summary_cases_and_readers.plantuml similarity index 100% rename from doc/summary_cases_and_readers.plantuml rename to docs/class-diagrams/summary_cases_and_readers.plantuml diff --git a/doc/view_classes.plantuml b/docs/class-diagrams/view_classes.plantuml similarity index 100% rename from doc/view_classes.plantuml rename to docs/class-diagrams/view_classes.plantuml diff --git a/doc/view_linking.plantuml b/docs/class-diagrams/view_linking.plantuml similarity index 100% rename from doc/view_linking.plantuml rename to docs/class-diagrams/view_linking.plantuml diff --git a/doc/viewer_display_generation_sequence.plantuml b/docs/class-diagrams/viewer_display_generation_sequence.plantuml similarity index 100% rename from doc/viewer_display_generation_sequence.plantuml rename to docs/class-diagrams/viewer_display_generation_sequence.plantuml diff --git a/doc/well-target-3deditor.plantuml b/docs/class-diagrams/well-target-3deditor.plantuml similarity index 100% rename from doc/well-target-3deditor.plantuml rename to docs/class-diagrams/well-target-3deditor.plantuml diff --git a/doc/well_geometry_classes.plantuml b/docs/class-diagrams/well_geometry_classes.plantuml similarity index 100% rename from doc/well_geometry_classes.plantuml rename to docs/class-diagrams/well_geometry_classes.plantuml diff --git a/doc/well_log_classes.plantuml b/docs/class-diagrams/well_log_classes.plantuml similarity index 100% rename from doc/well_log_classes.plantuml rename to docs/class-diagrams/well_log_classes.plantuml diff --git a/doc/well_path_part_manager.plantuml b/docs/class-diagrams/well_path_part_manager.plantuml similarity index 100% rename from doc/well_path_part_manager.plantuml rename to docs/class-diagrams/well_path_part_manager.plantuml diff --git a/doc/spell-checking.md b/docs/spell-checking.md similarity index 100% rename from doc/spell-checking.md rename to docs/spell-checking.md