Skip to content

Remove the load_MDL / unload_MDL / get_MDL_no wrappers #3

Description

@apetros

Follows SPS-L/stepss-ramses#4, which removes the runtime DLL model loader from the engine. These wrappers are the Python half of that API and go with it.

The loader was an HQ-specific implementation. User models now reach the engine through cg-studio and the codegen/gfortran uramses toolchain, which links them into a custom ramses.so / ramses.dll rather than loading a library at run time.

What to remove

src/stepss/simulator.py, lines 1018-1072:

  • sim.load_MDL(MDLName) calling c_load_MDL
  • sim.unload_MDL(MDLName) calling c_unload_MDL
  • sim.get_MDL_no() calling c_get_MDL_no

There is no wrapper for c_get_MDL_names, so the engine entry has no Python caller at all.

Why these are already unusable

The three C entries they bind sit behind #if defined __INTEL_COMPILER && (defined _WIN64 || defined _WIN32) in the engine. Every ramses.so / ramses.dll bundled in the wheel is a gfortran build, so self._ramseslib.c_load_MDL raises AttributeError on the bundled libraries for every platform we ship. The docs already carry a caution saying exactly this, in python/api-reference.md.

The docstring examples are broken independently of that: they call stepss.sim.load_MDL("MDLs.dll") on the class, before ram = stepss.sim() exists. That is an unbound call on an instance method that dereferences self._ramseslib, so it would fail with TypeError even on an Intel Windows build. Nothing in the test suite touches any of the three, which is why it never surfaced.

Coordination

Removing public methods from sim is an API change even though they cannot work today, so it belongs in the release notes for whichever version ships it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions