Skip to content

Rename simmit module and cleanup legacy naming #53

@kmarchais

Description

@kmarchais

Background

The Python bindings currently use legacy naming from when the project used Boost.Python:

  • The C++ module is named simmit (compiled to simmit.cpython-xxx.so)
  • The main wrapper file is named boostpython_smartplus_wrappers.cpp despite using pybind11
  • Users import via import simcoon, which internally does from simcoon.simmit import *

Proposed Changes

1. Rename the C++ module from simmit to _core

Following Python conventions, internal C extension modules are typically prefixed with _:

  • simmit.cpython-xxx.so_core.cpython-xxx.so

Files to modify:

  • simcoon-python-builder/CMakeLists.txt: Change pybind11_add_module(simmit ...) to pybind11_add_module(_core ...)
  • python-setup/simcoon/__init__.py: Change from simcoon.simmit import * to from simcoon._core import *

2. Rename the wrapper source file

  • simcoon-python-builder/src/python_wrappers/boostpython_smartplus_wrappers.cpppython_module.cpp

Files to modify:

  • simcoon-python-builder/CMakeLists.txt: Update source file path

3. Update PYBIND11_MODULE declaration

In the wrapper file, update the module name:

// Before
PYBIND11_MODULE(simmit, m) {

// After  
PYBIND11_MODULE(_core, m) {

Import behavior (unchanged)

Users will continue to use:

import simcoon
simcoon.L_iso(...)

The internal module name (_core vs simmit) is an implementation detail not exposed to users.

Checklist

  • Rename boostpython_smartplus_wrappers.cpp to python_module.cpp
  • Rename CMake target from simmit to _core
  • Update PYBIND11_MODULE(simmit, m) to PYBIND11_MODULE(_core, m)
  • Update __init__.py import
  • Update any documentation references
  • Test that import simcoon still works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions