Skip to content

Code quality improvements - #92

Merged
oberbichler merged 4 commits into
masterfrom
code-quality
Jul 26, 2026
Merged

Code quality improvements#92
oberbichler merged 4 commits into
masterfrom
code-quality

Conversation

@oberbichler

Copy link
Copy Markdown
Owner

Summary

Phase 4 of the modernization plan (follow-up to #91), in four commits:

fix: Misspelled public names corrected

  • SteepestDecentSteepestDescent (class, header, Python name), Timer.ellapsedTimer.elapsed
  • The old names stay available as deprecated aliases — existing scripts keep working
  • test_iga_rotation_copling_ad.py..._coupling_...

build: C++20

refactor: Python bindings decoupled from the C++ core

  • All register_python methods and trampoline classes moved to a dedicated bindings layer (src/bindings/, one TU per group: core, elements, solvers, problem, objectives)
  • The core under include/eqlib/ no longer depends on pybind11 — verified by compiling a pure C++ TU without pybind11 on the include path
  • Splitting into six translation units enables parallel builds
  • Side effects surfaced by multiple TUs, now fixed: missing Log.h include in Problem.h, ODR violation in Settings.h (get_or_default not inline)
  • PYBIND11_OVERLOAD_PUREPYBIND11_OVERRIDE_PURE; redundant explicit GIL acquisition removed from lambda elements

chore: pre-commit + clang-tidy + CI lint job

  • clang-format, ruff (check + format), whitespace hooks; codebase reformatted once
  • .clang-tidy config (bugprone/performance/modernize) for local use

Verification

  • 43/43 tests pass on Python 3.13 (macOS/arm64)
  • Core headers compile standalone as plain C++20 without pybind11
  • pre-commit run --all-files passes

Behavior notes

  • Python API unchanged except the corrected names (old spellings remain as aliases)
  • Registration order of all classes preserved

- SteepestDecent -> SteepestDescent (class, header, Python name)
- Timer.ellapsed -> Timer.elapsed
- deprecated aliases SteepestDecent and Timer.ellapsed remain available
- rename test_iga_rotation_copling_ad.py -> test_iga_rotation_coupling_ad.py
- move all register_python methods and trampoline classes into a
  dedicated bindings layer (src/bindings/, one TU per group)
- core headers under include/eqlib/ no longer depend on pybind11;
  they compile as a plain C++ library
- guard the python section of the vendored hyperjet so it only
  compiles when pybind11 is included
- drop redundant explicit GIL acquisition in the lambda elements
  (pybind11's std::function caster handles this)
- make members that are exposed via Python public (Problem type
  aliases, element setters, lambda ComputeFunction)
- mark get_or_default inline (ODR violation surfaced by multiple TUs)
- PYBIND11_OVERLOAD_PURE -> PYBIND11_OVERRIDE_PURE
- splitting into six translation units also enables parallel builds
- pre-commit: clang-format, ruff (check + format), whitespace/eol hooks
- .clang-tidy with bugprone/performance/modernize checks
- lint job in CI runs pre-commit on all files
- reformat codebase (clang-format + ruff)
@oberbichler oberbichler changed the title refactor: code quality improvements (phase 4) Code quality improvements Jul 26, 2026
@oberbichler
oberbichler merged commit 62772be into master Jul 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant