Skip to content

GIS2PROF#154

Open
kdberends wants to merge 2 commits into
masterfrom
feature/gis2prof
Open

GIS2PROF#154
kdberends wants to merge 2 commits into
masterfrom
feature/gis2prof

Conversation

@kdberends

Copy link
Copy Markdown
Member

Refactor of the Import functionality

Refactors the import functionality from data_import.py into a dedicated imports package, following the same pattern as the existing export module.

New structure:

  • base.py — Abstract BaseImporter class and generalized ModelData (replacing FmModelData)
  • dflowfm.pyDFlowFMImporter migrated from FMDataImporter, implementing import_data() -> ModelData
  • factory.pyImporterFactory.create(source, file_path) for source-agnostic importer instantiation
  • __init__.py — Public API exports

Updated files:

  • fm2prof_runner.py — Uses ImporterFactory and ModelData instead of FMDataImporter/FmModelData
  • polygon_file.py — Uses ImporterFactory.create("dflowfm", ...) instead of FMDataImporter directly
  • test_data_import.py — Updated to use DFlowFMImporter and ModelData

Backwards compatibility: FMDataImporter and FmModelData remain in data_import.py with DeprecationWarnings. ImportInputFiles is unchanged.

@sonarqubecloud

Copy link
Copy Markdown

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