Repository navigation
Conversation
A scenario is a name and the parameter values that make it, such as
"high salt" for `salt_kg` at 0.02. `GET /db/{db}/scenarios` lists them,
`PUT /db/{db}/scenarios/{name}` saves one, replacing what that name held,
and `DELETE /db/{db}/scenarios/{name}` drops it. To score one, a client
sends its values as the parameters of a scoring request, so the engine
never scores a scenario by name.
Scenarios are kept in a journal of their own, `scenarios/journal.jsonl`
in the database's upload directory, apart from the database's journal:
saving one changes nothing in the database, so it must not look like an
edit to the cache or to a replay. Nothing is held in memory; each listing,
save and drop reads that file.
Refused, with the reason: values a scoring request would refuse (an
unknown parameter, a formula, a process that is not there), a scenario
that sets nothing, a drop of a name that holds none, and any save on a
database the engine reads from its configuration, where the scenario
would be lost at the next restart. A scenario that an edit of the
database has since made unusable is listed with the problem. A copy of a
database takes its scenarios along.
The assistant has `list_scenarios`, `save_scenario` and `drop_scenario`,
and pyvolca `scenarios()`, `save_scenario()` and `drop_scenario()`. Wire
revision 75.
… around it A scenario named "mix 50/50" or "salt #2" reached the engine as another path, or cut short: pyvolca now percent-encodes every value it puts in a path. A name with a space at either end was saved as typed, so it could not be told from the name without the space: it is now refused. The scenario name gets its own type, so it cannot be swapped with the name of the database beside it.
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.
Save named sets of parameter values on a database
A scenario is a name and the parameter values that make it, such as
"high salt" for
salt_kgat 0.02.GET /db/{db}/scenarioslists them,PUT /db/{db}/scenarios/{name}saves one, replacing what that name held,and
DELETE /db/{db}/scenarios/{name}drops it. To score one, a clientsends its values as the parameters of a scoring request, so the engine
never scores a scenario by name.
Scenarios are kept in a journal of their own,
scenarios/journal.jsonlin the database's upload directory, apart from the database's journal:
saving one changes nothing in the database, so it must not look like an
edit to the cache or to a replay. Nothing is held in memory; each listing,
save and drop reads that file.
Refused, with the reason: values a scoring request would refuse (an
unknown parameter, a formula, a process that is not there), a scenario
that sets nothing, a drop of a name that holds none, and any save on a
database the engine reads from its configuration, where the scenario
would be lost at the next restart. A scenario that an edit of the
database has since made unusable is listed with the problem. A copy of a
database takes its scenarios along.
The assistant has
list_scenarios,save_scenarioanddrop_scenario,and pyvolca
scenarios(),save_scenario()anddrop_scenario(). Wirerevision 75.