gpf_instance package

Submodules

gpf_instance.apps module

Provides class for configuing WDAE Django application.

class gpf_instance.apps.WDAEConfig(app_name, app_module)[source]

Bases: AppConfig

Configure WDAE django application.

name = 'gpf_instance'
ready() None[source]

Override this method in subclasses to run code when Django starts.

gpf_instance.extension module

class gpf_instance.extension.GPFExtensionBase(instance: Any)[source]

Bases: object

Base class for GPF extensions.

GPF extensions can handle adding new studies and support for various GPF tools to an instance.

abstractmethod get_studies() list[WDAEAbstractStudy][source]
abstractmethod get_studies_ids() list[str][source]
get_tool(study: WDAEAbstractStudy, tool_id: str) GPFTool | None[source]
setup() None[source]
class gpf_instance.extension.GPFTool(tool_id: str)[source]

Bases: object

Base class for implementing GPF tools.

GPF tools are classes which interact with studies to provide data.

abstractmethod static make_tool(study: WDAEAbstractStudy) GPFTool | None[source]
property tool_id: str

gpf_instance.feature_flags module

Feature flag registry for the GPF web API.

class gpf_instance.feature_flags.FeatureFlagMixin[source]

Bases: object

Mixin that gates a view behind a feature flag.

Set feature_flag on the subclass to the flag name. The view returns 404 when the flag is disabled so the endpoint is not advertised.

Usage:

class MyView(FeatureFlagMixin, QueryBaseView):
    feature_flag = "my_feature"
dispatch(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]
feature_flag: str = ''
class gpf_instance.feature_flags.FeatureFlags(flags: dict[str, bool])[source]

Bases: object

Singleton registry of web-API feature flags.

get_all() dict[str, bool][source]

Return all flags as a name→enabled mapping.

is_enabled(name: str) bool[source]

Return True if the named feature is enabled.

gpf_instance.feature_flags.get_feature_flags() FeatureFlags[source]

Return the process-wide FeatureFlags singleton.

gpf_instance.feature_flags.reset_feature_flags() None[source]

Drop the cached singleton so the next access re-reads settings.

Feature flags are snapshotted once per process; call this after changing settings.FEATURE_FLAGS (chiefly in tests via override_settings) so the change takes effect.

gpf_instance.gpf_instance module

Provides wdae GPFInstance class.

gpf_instance.gpf_instance.get_wgpf_instance(config_filename: str | Path | None = None, **kwargs: Any) WGPFInstance[source]

Load and return a WGPFInstance.

gpf_instance.urls module

gpf_instance.views module

Module contents