Skip to content

Incosistent rekenresultaat debug - #113

Merged
VincentJilesen merged 10 commits into
betafrom
incosistent-rekenresultaat-debug
Aug 21, 2026
Merged

Incosistent rekenresultaat debug#113
VincentJilesen merged 10 commits into
betafrom
incosistent-rekenresultaat-debug

Conversation

@chrispijo

@chrispijo chrispijo commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Zie issue met verdere uitleg.

@chrispijo chrispijo linked an issue Aug 20, 2026 that may be closed by this pull request

def _run_calculation(row_unique: dict) -> SystemCalculation:
debug: bool = os.environ.get("GEOPROB_DEBUG", False)
if debug: logger.debug("Start berekening voor %s", row_unique)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik heb het overzichtelijker gemaakt door if debug: te gebruiken.

), None, None
# logger = logging.getLogger(__name__)
calc = _run_calculation(row_unique)
result = _collect_results(calc)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zoals eerder al besproken, de regels code in _worker korter gemaakt door de logica op te splitsen naar twee sub-functies.

error_count_append = ""
if self.log_errors > 0:
error_count_append = f" (of which {self.log_errors} failed calculations)"
if self.n_calc_totaal == self.done:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ook een progress report toegevoegd na het uitvoeren van de laatste berekening.

CALCULATION_MAPPER[geohydrologisch_model]['system_builder'](
geopackage_filepath=geopackage_filepath,
to_run_vakken_ids=to_run_vakken_ids))
class BuildAndRunCalculations:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zoals eerder besproken, functie omgezet naar class zodat alle onderdelen in aparte methods te zetten zijn met elk een beperkt aantal regels.

@chrispijo chrispijo added bug Something isn't working ready for review labels Aug 21, 2026
@chrispijo

Copy link
Copy Markdown
Collaborator Author

Na aanleiding van review de code wat heringedeeld. @VincentJilesen. Kun jij deze aanpassingen nog een keer reviewen?

@VincentJilesen
VincentJilesen merged commit bd63623 into beta Aug 21, 2026
1 check passed
@VincentJilesen
VincentJilesen deleted the incosistent-rekenresultaat-debug branch August 21, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incidenteel inconsistent rekenresultaat

2 participants