Configuration

StarfishConfig

class starfish.config.StarfishConfig[source]

Application specific configuration settings which can be loaded throughout the starfish codebase.

Examples

Check strict property

>>> from starfish.config import StarfishConfig
>>> config = StarfishConfig()
>>> if config.strict:
>>>     validate(json)

Default starfish configuration equivalent:

>>> {
>>>     "slicedimage": {
>>>         "caching": {
>>>             "debug": false,
>>>             "directory": "~/.starfish/cache",
>>>             "size_limit": 5e9
>>>         },
>>>     },
>>>     "validation": {
>>>         "strict": false
>>>     },
>>>     "verbose": true
>>> }

Example of a ~/.starfish.config file to disable caching:

>>> {
>>>     "slicedimage": {
>>>         "caching": {
>>>             "size_limit": 0
>>>         }
>>>     }
>>> }
Attributes
slicedimagedictionary

Subdictionary that can be passed to slicedimage.io methods.

strictbool

Whether or not loaded json should be validated.

verbosebool

Controls output like from tqdm

Methods

flag

environ

class starfish.config.environ(**kwargs)[source]

Overrides environment variables (prefixed with STARFISH_) for the duration of the call.

Examples

Turn on validation:

>>> from starfish.config import environ
>>> from starfish import Experiment
>>> with environ(VALIDATION_STRICT="true"):
>>>     Experiment.from_json(URL)