Skip to content

SINTEF/FEEMS

Repository files navigation

FEEMS Ecosystem - Workspace

Python 3.10+ uv License

This is the monorepo for the FEEMS (Fuel, Emissions, Energy Calculation for Machinery System) ecosystem - a comprehensive suite of packages for modeling, simulating, and analyzing marine power and propulsion systems.

🎯 Overview

The FEEMS ecosystem enables accurate calculation of fuel consumption, emissions, and energy balance for complex marine machinery configurations. It supports vessel design, operational planning, emissions compliance, and performance optimization.

πŸ“¦ Packages

Core Packages

Package Version Description License
feems PyPI Core modeling framework for marine power systems MIT
MachSysS PyPI Protocol Buffer definitions and data conversion Apache-2.0
RunFeemsSim PyPI High-level simulation interface with PMS logic Apache-2.0

Package Relationships

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  User Applications                   β”‚
β”‚        (Route Planning, Emissions Reporting)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚                       β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ RunFeemsSim β”‚         β”‚  MachSysS    β”‚
    β”‚ Simulation  │◄───────── Data Exchangeβ”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                       β”‚
           β”‚      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚      β”‚
        β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”
        β”‚   feems     β”‚
        β”‚ Core Engine β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Python β‰₯ 3.10, < 3.13
  • uv (recommended) or pip
  • protoc (optional, only needed for MachSysS development)

Installation

For Users (Individual Packages)

Install packages as needed from PyPI:

# Core functionality
pip install feems

# With data serialization
pip install feems MachSysS

# Complete suite with simulation interface
pip install feems MachSysS RunFeemsSim

For Developers (Full Workspace)

Clone and setup the complete workspace:

# Clone repository
git clone https://github.com/SINTEF/FEEMS.git
cd FEEMS

# Setup with uv (recommended)
uv sync

# Or with pip
pip install -e feems/ -e machinery-system-structure/ -e RunFEEMSSim/

This installs all packages in editable mode with development dependencies.

Verify Installation

# Check installations
python -c "import feems; print(f'FEEMS {feems.__version__}')"
python -c "import MachSysS; print('MachSysS OK')"
python -c "import RunFeemsSim; print('RunFeemsSim OK')"

# Run tests
uv run pytest

πŸ“š Documentation

Package Documentation

Each package has comprehensive documentation:

Examples

Comprehensive examples with detailed explanations:

Guides

CHANGELOGs

πŸ› οΈ Development

Workspace Structure

FEEMS/
β”œβ”€β”€ feems/                          # Core library
β”‚   β”œβ”€β”€ feems/                      # Source code
β”‚   β”œβ”€β”€ tests/                      # Tests
β”‚   β”œβ”€β”€ README.md                   # Documentation
β”‚   β”œβ”€β”€ API_REFERENCE.md            # API docs
β”‚   β”œβ”€β”€ CHANGELOG.md                # Version history
β”‚   └── pyproject.toml              # Package config
β”‚
β”œβ”€β”€ machinery-system-structure/      # MachSysS
β”‚   β”œβ”€β”€ MachSysS/                   # Source code
β”‚   β”œβ”€β”€ proto/                      # Protocol Buffer definitions
β”‚   β”œβ”€β”€ tests/                      # Tests
β”‚   β”œβ”€β”€ compile_proto.sh            # Protobuf compiler script
β”‚   β”œβ”€β”€ README.md                   # Documentation
β”‚   β”œβ”€β”€ CHANGELOG.md                # Version history
β”‚   └── pyproject.toml              # Package config
β”‚
β”œβ”€β”€ RunFEEMSSim/                    # RunFeemsSim
β”‚   β”œβ”€β”€ RunFeemsSim/                # Source code
β”‚   β”œβ”€β”€ tests/                      # Tests
β”‚   β”œβ”€β”€ README.md                   # Documentation
β”‚   β”œβ”€β”€ CHANGELOG.md                # Version history
β”‚   β”œβ”€β”€ MIGRATION_FROM_NBDEV.md     # nbdev migration guide
β”‚   └── pyproject.toml              # Package config
β”‚
β”œβ”€β”€ examples/                        # Examples and tutorials
β”‚   β”œβ”€β”€ *.ipynb                     # Jupyter notebooks
β”‚   β”œβ”€β”€ *.py                        # Python scripts
β”‚   β”œβ”€β”€ README.md                   # Examples guide
β”‚   └── data/                       # Example data
β”‚
β”œβ”€β”€ pyproject.toml                   # Workspace configuration
β”œβ”€β”€ uv.lock                         # Dependency lock file
β”œβ”€β”€ README.md                       # This file
└── CLAUDE.md                       # Development guide

Development Workflow

1. Setup Development Environment

# Initial setup
git clone https://github.com/SINTEF/FEEMS.git
cd FEEMS
uv sync

# Activate virtual environment (if needed)
source .venv/bin/activate  # Unix/macOS
# or
.venv\Scripts\activate     # Windows

2. Making Changes

# Edit code in your preferred editor
vim feems/feems/system_model.py

# Run tests for changed package
uv run pytest feems/tests/

# Run all tests
uv run pytest

# Lint and format
uv run ruff check .
uv run ruff format .

3. Testing

# Run all tests
uv run pytest

# Run tests for specific package
uv run pytest feems/tests/
uv run pytest machinery-system-structure/tests/
uv run pytest RunFEEMSSim/tests/

# Run with coverage
uv run pytest --cov=feems --cov=MachSysS --cov=RunFeemsSim

# Run specific test file
uv run pytest feems/tests/test_system_model.py

# Run specific test
uv run pytest feems/tests/test_system_model.py::test_power_balance

4. Code Quality

# Check code quality
uv run ruff check .

# Auto-fix issues
uv run ruff check --fix .

# Format code
uv run ruff format .

# Type checking (if mypy configured)
uv run mypy feems/

5. Building Packages

# Build specific package
cd feems
uv build

# Build all packages
for dir in feems machinery-system-structure RunFEEMSSim; do
    (cd $dir && uv build)
done

6. Documentation

# Edit documentation
vim feems/README.md

# Preview examples (Jupyter)
uv run jupyter lab examples/

# Generate docs (if using Sphinx)
cd docs
uv run make html

Common Tasks

Update Dependencies

# Update all dependencies
uv sync --upgrade

# Update specific package
uv add pandas@latest --package feems

Add New Dependency

# Add to specific package
cd feems
uv add scipy

# Add dev dependency
uv add --dev pytest-cov

Regenerate Protocol Buffers (MachSysS)

cd machinery-system-structure
./compile_proto.sh

πŸ§ͺ Testing Strategy

Test Organization

  • Unit Tests: Test individual components and functions
  • Integration Tests: Test package interactions
  • System Tests: Test complete workflows

Running Tests

# Fast: Run only modified tests
uv run pytest --lf

# Complete: Run all tests with coverage
uv run pytest --cov --cov-report=html

# Verbose: Detailed output
uv run pytest -v

# Parallel: Speed up with multiple processes
uv run pytest -n auto

Test Coverage Goals

  • feems: > 80% coverage
  • MachSysS: > 70% coverage
  • RunFeemsSim: > 75% coverage

πŸ“Š Code Quality

Linting and Formatting

The workspace uses ruff for linting and formatting:

# Check all packages
uv run ruff check .

# Format all packages
uv run ruff format .

# Check specific package
uv run ruff check feems/

Configuration

Ruff is configured in pyproject.toml:

  • Line length: 120
  • Target: Python 3.10+
  • Excludes: Generated files (*_pb2.py, *_pb2.pyi, _modidx.py)

Type Checking

Optional but recommended:

uv run mypy feems/
uv run mypy RunFeemsSim/

🚒 Publishing

Pre-Publication Checklist

  • All tests pass
  • Code is formatted and linted
  • Documentation is updated
  • CHANGELOGs are updated
  • Version numbers are bumped
  • Examples work correctly

Build Packages

# Build each package
cd feems && uv build && cd ..
cd machinery-system-structure && uv build && cd ..
cd RunFEEMSSim && uv build && cd ..

Test in Clean Environment

# Create clean environment
uv venv test-env
source test-env/bin/activate

# Install built packages
pip install feems/dist/*.whl
pip install machinery-system-structure/dist/*.whl
pip install RunFEEMSSim/dist/*.whl

# Test imports
python -c "import feems; import MachSysS; import RunFeemsSim"

# Deactivate and remove
deactivate
rm -rf test-env

Publish to PyPI

# Test PyPI first (recommended)
uv publish --repository testpypi feems/dist/*
uv publish --repository testpypi machinery-system-structure/dist/*
uv publish --repository testpypi RunFEEMSSim/dist/*

# Verify on Test PyPI
pip install --index-url https://test.pypi.org/simple/ feems

# If all looks good, publish to PyPI
uv publish feems/dist/*
uv publish machinery-system-structure/dist/*
uv publish RunFEEMSSim/dist/*

🀝 Contributing

We welcome contributions! Please see individual package documentation for specific guidelines.

Getting Started

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Contribution Guidelines

  • Follow existing code style (enforced by ruff)
  • Add tests for new features
  • Update documentation
  • Keep commits atomic and well-described
  • Ensure all tests pass before submitting PR

Code Review Process

  1. Automated checks run (tests, linting)
  2. Maintainers review code
  3. Address feedback
  4. Merge when approved

πŸ“„ License

  • feems: MIT License
  • MachSysS: Apache License 2.0
  • RunFeemsSim: Apache License 2.0

See individual package LICENSE files for details.

πŸ†˜ Support

Getting Help

Reporting Issues

When reporting issues, please include:

  • Package and version
  • Python version
  • Operating system
  • Minimal reproducible example
  • Expected vs actual behavior

Feature Requests

We welcome feature requests! Please:

  • Check existing issues first
  • Describe the use case
  • Explain expected behavior
  • Consider contributing the feature

πŸ† Acknowledgments

The FEEMS ecosystem is developed and maintained by SINTEF Ocean, Norway's leading marine technology research institute.

About SINTEF Ocean

SINTEF Ocean conducts research and innovation within maritime technology, ocean space technology, and marine environment and operations. The institute works on:

  • Decarbonization of maritime transport
  • Alternative marine fuels (hydrogen, ammonia, methanol)
  • Hybrid and electric propulsion systems
  • Energy efficiency and emissions reduction
  • Digital twins and simulation-based design

Research Applications

FEEMS has been applied in various research projects including:

  • Design and optimization of hydrogen fuel cell powered ferries
  • FuelEU Maritime regulation compliance analysis
  • Hybrid propulsion system sizing and optimization
  • Total cost of ownership (TCO) analysis for alternative fuel vessels
  • Operational performance prediction and validation

Contributors

See CONTRIBUTORS.md for the list of contributors.

Funding

This work has been supported by various research projects and industry collaborations focused on sustainable maritime transport.

πŸ“ˆ Project Status

  • feems: Stable PyPI
  • MachSysS: Stable PyPI
  • RunFeemsSim: Pre-Alpha PyPI

Roadmap

See individual package CHANGELOGs and GitHub milestones for planned features.

πŸ“š Citation

If you use FEEMS in your research or publications, please cite:

Software:

@software{feems2024,
  title = {FEEMS: Fuel, Emissions, Energy Calculation for Machinery System},
  author = {Yum, Kevin Koosup and contributors},
  year = {2024},
  organization = {SINTEF Ocean},
  url = {https://github.com/SINTEF/FEEMS}
}

Academic Paper:

@inproceedings{yum2024designlab,
  title = {Design Lab: A Simulation-Based Approach for the Design of Maritime Vessels Using Hydrogen Fuel Cells},
  author = {Yum, Kevin Kosup and Tavakoli, Sadi and Aarseth, Torstein and Bremnes Nielsen, JΓΈrgen and Sternesen, Dag},
  year = {2024},
  booktitle = {Proceedings of the Maritime Conference},
  organization = {SINTEF Ocean},
  note = {Case study: STENA Jutlandica ferry hydrogen fuel cell conversion analysis}
}

πŸ”— Links


About

FEEMS is modeling framework for a marine power and propulsion system for calculation of fuel consumption, emissions, and energy balance with the input of operation mode and external power load.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors