Skip to content

[Task] Merge DataFileClass and OsemosysClass for v5.6, keep MUIOGO solver code #460

@SeaCelo

Description

@SeaCelo

Biggest piece of the v5.6 sync. Upstream extracted ~1,800 lines of DataFileClass into the new HelpersClass, and rewrote how OsemosysClass finds the GLPK/CBC solver on the user's machine. We need to absorb the helpers refactor without losing MUIOGO's solver-resolution work.

What's in scope:

  • merge upstream's DataFileClass.py rewrite (use the Helpers extraction)
  • merge upstream's OsemosysClass.py constructor refactor (Path-based, Helpers-based parameter building)
  • keep MUIOGO's solver-resolution chain (env var → shutil.which → bundled). Adopting upstream's version wholesale would re-introduce bugs we already fixed in [Bug] Non-Windows solver paths in OsemosysClass are hardcoded dead-end stubs #43, [Bug] Windows .bat installation fails 🦇 #86, fix(windows): improve solver installation flow with CBC fallback (Refs #86) #101, Fix Windows GLPK fallback in setup #262
  • borrow only: macOS Homebrew + Linux distro PATH probes, and the is_bundled-conditional cwd pattern in DataFileClass.run
  • drop MUIOGO's recursive bundled-folder search (dead code today)
  • drop upstream's dormant run_26022026 method (it contains shell=True calls; UPSTREAM_SYNC.md rejects)
  • preserve Config.validate_path(Config.DATA_STORAGE, case) as the first line of OsemosysClass.__init__ (MUIOGO security fix from dc8f3c60, not present upstream)
  • guard the Indicators.json / Duals.json reads in the constructor with try/except → empty dict
  • use self.genData.get('osy-indicators', []) instead of unguarded subscript
  • backend CaseRoute.py (/saveParamFile route): persist DualData and IndicatorData alongside ParamData and VarData

What's not in scope:

  • frontend changes (handled separately)
  • upload/config view (handled in the cosmetic sub-issue)

Done when:

  • branch base: feature/v56-ui-sync
  • demo case solves end-to-end with both GLPK and CBC
  • on macOS: brew install glpk cbc works, app finds solvers
  • on Linux: equivalent via apt
  • on Windows: existing solver detection preserved

Notes:

Related: #457, #43, #86, #101, #262, docs/UPSTREAM_SYNC.md

Metadata

Metadata

Assignees

Labels

Track: Upstream SyncPulling upstream MUIO releases into MUIOGO

Type

No type
No fields configured for issues without a type.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions