Repository navigation
Conversation
trans_pot_t omitted id_run from its key columns, so upserting a run's potentials rewrote any other run's rows for the same transition, period and coordinate, including the parent's. Add id_run to the key, as for the other run-partitioned tables. That exposed a second problem in the run-lineage read expression: tables without id_period grouped by id_run as well, so every run in the lineage was returned instead of the nearest one holding data. Group by the inheritance keys only, and handle tables with no inheritance key at all. Export alloc_clumpy_one_period() with a `db` argument instead of `self`. It returns the posterior map without committing it, so callers can edit trans_pot_t before and the allocated map after each period. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
alloc_dinamica_one_period() now mirrors alloc_clumpy_one_period(): it takes `db`, derives the anterior map itself, reuses existing trans_pot_t (with use_parent_trans_pot / force_predict_trans_pot) and returns the posterior map without committing it. It works in a temporary directory by default and removes it afterwards. alloc_dinamica() is a thin loop over it, and its work_dir now also defaults to a temporary directory. Both allocators share predict_trans_pot_for_alloc() for the parent-run handling. Move the trans_pot_t lineage test into test_db_evoland.R, reusing its open database, and note the convention in AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
The test derived work_dir from dirname(db$catalog). Under DuckLake the catalog is "sqlite:/tmp/.../catalog.sqlite", so that produced a relative "sqlite:/tmp/..." directory wherever the tests ran. work_dir now defaults to a temporary directory, so the argument is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
Recomputing neighbour predictors after the last requested period is wasted work when nothing is allocated onwards from it, e.g. in single-period ensembles. update_neighbors = FALSE skips that final upsert; intermediate periods are always updated because the next prediction reads them. The default keeps the current behaviour.
alloc_clumpy_one_period() and alloc_dinamica_one_period() had help pages of their own that largely repeated alloc_clumpy / alloc_dinamica. They now sit on those pages via @describeIn, with the shared arguments documented once. Each page opens with when to use the multi-period method (commits each period, refreshes neighbour predictors) and when to use the single-period function (returns the map uncommitted; the caller commits and refreshes neighbours). AGENTS.md: tests needing a longer series of database manipulations go in test_integ_*.R. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
… change Keeps the update_neighbors code and parameter docs from #50 on the restructured allocator help pages; man pages regenerated with roxygen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
intrv_meta_t and intrv_masks_t were never read by anything, and intervention machinery is not meant to live in the package. Remove them, their tests, bindings and docs, and reword the remaining mentions. In their place, vignettes/policy-mechanisms.qmd shows how scenario-specific policy is expressed with the tables the simulation already reads, each on a run of its own and compared against a business-as-usual run: - settlement form (compact development) through alloc_params_t, - spatial steering (building zones, nature conservation) through multiplicative adjustments of trans_pot_t before allocation, - exogenous change (a reservoir project) through edits of the allocated map before it is committed, using the exported single-period allocator for the per-period steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
mmyrte
changed the base branch from
claude/confident-albattani-56osfg
to
develop
September 24, 2026 10:37
Conflicts in the allocator docs resolved to develop's version, with this branch's one change re-applied (no "e.g. interventions"); man pages regenerated with roxygen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
…lbattani-56osfg-scenario-levers
Merges develop, which added the diagram and its CI check after this branch removed the tables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #49, which provides the exported single-period allocators and per-run
trans_pot_tthat the vignette uses. Once #49 merges, retarget this PR todevelop.Removal
Nothing read
intrv_meta_torintrv_masks_t, and intervention machinery isn't meant to live in the package. This PR removes:R/intrv_meta_t.R,R/intrv_masks_t.R, their tests and.Rdpages;evoland_dbtable bindings, theCollateentries and the NAMESPACE exports (as_intrv_*,create_intrv_meta_t).It also rewords the remaining mentions:
util_download, thecreate_lulc_meta_t/create_pred_meta_tdocs (which said "intervention specifications"), the allocator docs, the intro vignette and the README.Breaking: databases that already hold
intrv_*tables keep them in the catalog, but the package no longer binds them.Vignette:
vignettes/policy-mechanisms.qmdShows how scenario-specific policy is expressed with the tables the simulation already reads. Each mechanism goes on a run of its own and is compared against a business-as-usual run. It's named after the policy represented rather than the model step, since potentials are adjusted before allocation:
alloc_params_ttrans_pot_t, after prediction and before allocationlulc_data_t, edited before committingThe vignette also explains:
trans_pot_tslice must be written back;upsert_new_neighbors()order.A short note maps the terms to SSP-CH's "pre-allocation / allocation / post-allocation" interventions.
It reuses the synthetic landscape from
stochastic-allocation-sensitivity.qmd(code folded) and renders withquarto render. On that render:Tests
tinytest::build_install_test(): all ok, 619 results.🤖 Generated with Claude Code
https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
Generated by Claude Code