This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
OSPSuite.Core is the core library for the Open Systems Pharmacology Suite - a C#/.NET framework for model-based systems pharmacology providing domain modeling, simulation, and analysis capabilities.
# Restore and build
dotnet restore
dotnet build OSPSuite.Core.sln
# Run all tests
dotnet test
# Run specific test project
dotnet test tests/OSPSuite.Core.Tests
dotnet test tests/OSPSuite.Core.IntegrationTests
# Run tests with filter
dotnet test tests/OSPSuite.Core.Tests --filter "FullyQualifiedName~ClassName"
# Code coverage (requires Ruby)
rake cover
# Create local NuGet packages
rake create_local_nuget
# Update local MoBi/PK-Sim with new packages
rake create_local_nuget[m] # update MoBi
rake create_local_nuget[p] # update PK-SimLayered architecture with clear separation:
- OSPSuite.Core - Domain model, services, serialization (netstandard2.0)
- OSPSuite.Infrastructure - Cross-cutting concerns: logging, IO, serialization implementations
- OSPSuite.Presentation - MVP pattern presenters, DTOs, view interfaces (DevExpress)
- OSPSuite.UI - WinForms view implementations
- OSPSuite.R - R language integration for scripting support
Key patterns:
- MVP (Model-View-Presenter) in Presentation/UI layers
- Command pattern for undo/redo via
Commandsnamespace - Constructor injection with IoC container (Castle Windsor or Autofac)
- Rich domain model with
IEntity/IContainerhierarchy
Uses BDD-style testing with OSPSuite.BDDHelper:
public abstract class concern_for_PopulationRunner : ContextForIntegration<IPopulationRunner>
{
public override void GlobalContext()
{
base.GlobalContext();
// Setup code
}
}
public class When_running_population : concern_for_PopulationRunner
{
[Observation]
public void should_return_expected_results()
{
_results.Count.ShouldBeEqualTo(2);
}
}- Test classes inherit from
concern_for_<SUT>orContextForIntegration<T> - Use
[Observation]attribute instead of[Test] - Assertions use
.ShouldBeEqualTo(),.ShouldBeTrue(), etc. - Mocking with FakeItEasy
Naming:
- Private fields:
_camelCase(underscore prefix) - Constants:
ALL_CAPS - Private methods:
camelCase - Public methods/properties:
PascalCase - Interfaces:
Iprefix
Style:
- 3 spaces indentation (no tabs)
- Always use braces for loops/conditionals, except when only a single line is nested
- No Hungarian notation
- English comments only
- Use constants for magic numbers/strings
- Return
IReadOnlyList/IReadOnlyCollectionfrom public APIs
- Default branch:
develop - Create feature branches off
develop - Reference issues:
Fixes #<issue-number> - Submodules:
src/OSPSuite.Dimensions,src/OSPSuite.PKParameters