Skip to content

Registry

The environment registry: make an environment by string id, and register_env to add your own.

Every built-in environment registers itself at import time (importing navix is enough), so navix.make(id) is the normal way to get an Environment. The ids follow MiniGrid's naming with a Navix- prefix and a -v0 suffix, e.g. Navix-Empty-5x5-v0, Navix-DoorKey-8x8-v0, Navix-MultiRoom-N4-S5-v0.

MiniGrid environment ids that navix does not yet cover. Currently empty - every MiniGrid id either has a Navix-* registration or resolves through V1_ALIASES. Kept as a named list so a future gap has an obvious place to be recorded.

MiniGrid -v1 ids that navix implements under a plain -v0 id rather than as a separate -v1 registration: for these families navix ports MiniGrid's -v1 behaviour and calls it -v0 (the per-environment behavioural difference is documented in each target's module docstring). make redirects a -v1 key here to its -v0 value and warns, so code written against MiniGrid's own id still resolves.

Builds a registered environment by id.

Parameters:

Name Type Description Default
name str

a registered id (see sorted(navix.registry()) for the full list). A handful of MiniGrid -v1 ids are accepted too and transparently redirected to their navix -v0 equivalent with a warning (see V1_ALIASES).

required
**kwargs

forwarded verbatim to the environment's constructor. Common ones: observation_fn (a function from navix.observations, default is environment-specific), gamma (discount, default 0.99), max_steps (episode truncation horizon, default 4 * height * width), observation_space (override the inferred Space). Anything the specific environment's create accepts also works.

{}

Returns:

Name Type Description
Environment

the constructed environment.

Raises:

Type Description
NotImplementedError

if name is not registered. The message lists close matches and links the feature-request form.

Example
import navix as nx
from navix import observations

env = nx.make(
    "Navix-DoorKey-8x8-v0",
    observation_fn=observations.rgb_first_person,
    gamma=0.995,
)

Adds an environment id to the registry (or overwrites one).

Parameters:

Name Type Description Default
name str

the id make will accept, e.g. "Navix-MyEnv-8x8-v0".

required
ctor Callable

builds and returns the Environment. make calls it as ctor(**kwargs), forwarding whatever keyword arguments were passed to make (observation_fn, gamma, max_steps, ...), so ctor typically ends in MyEnv.create(...).

required

The full id -> constructor mapping.

Returns:

Name Type Description
dict dict

maps each registered environment id (e.g.

dict

"Navix-Empty-5x5-v0") to a zero-argument-or-kwargs callable

dict

that builds the Environment. The live dict, not a copy -

dict

sorted(navix.registry()) lists every available id.