ecoli.library.updaters

Registry of Inverse Updaters

You should interpret words and phrases that appear fully capitalized in this document as described in RFC 2119. Here is a brief summary of the RFC:

  • “MUST” indicates absolute requirements. Vivarium may not work correctly if you don’t follow these.

  • “SHOULD” indicates strong suggestions. You might have a valid reason for deviating from them, but be careful that you understand the ramifications.

  • “MAY” indicates truly optional features that you can include or exclude as you wish.

Inverse Updaters

Inverse updaters accept a final and an initial state, and they attempt to compute an update that could be given to a particular updater to get from the initial state to the final state.

Inverse Updater API

An inverse updater MUST be registered with the same name as its associated updater. The function MUST accept exactly 2 positional arguments: the initial state and the final state. The function SHOULD not accept any other parameters. The function MUST return only the update needed to get from the initial state to the final state. The function SHOULD have a name that matches its associated updater function, only prefixed with inverse_. Inverse updaters MUST return an empty dictionary only if the update can be ignored.

ecoli.library.updaters._NO_UPDATE_NEEDED = 'No update needed'

Special signal used by _reverse_deep_merge to communicate that no updates are needed. Using this signal reduces the update size by eliminating subtrees of empty updates.

ecoli.library.updaters._reverse_deep_merge(initial, final)[source]
ecoli.library.updaters.inverse_update_accumulate(initial_state, final_state)[source]
ecoli.library.updaters.inverse_update_bulk_numpy(initial_state, final_state)[source]
ecoli.library.updaters.inverse_update_merge(initial_state, final_state)[source]
ecoli.library.updaters.inverse_update_nonnegative_accumulate(initial_state, final_state)[source]
ecoli.library.updaters.inverse_update_null(initial_state, final_state)[source]

The null updater ignores the update.

ecoli.library.updaters.inverse_update_set(initial_state, final_state)[source]
ecoli.library.updaters.inverse_update_unique_numpy(initial_state, final_state)[source]