pyns.endpoints.analysis.Analysis

class pyns.endpoints.analysis.Analysis(*, analyses, name, dataset_id, **kwargs)

Bases: object

Analysis interactive object.

This class is represents a specific instance of a Neuroscout Analysis that is synced with the API.

Analysis values (e.g. .model, .name) are set as attributes of the instance, and kept in sync with the API using the push and pull methods.

Most methods avaiable to Analyses are aliased here.

__init__(*, analyses, name, dataset_id, **kwargs)

Initate a new Analysis object. Typically, this is done by Analyses get_analysis or create_analysis methods.

Parameters:
  • analyses (Analyses) – Instantiated Analyses object

  • name (str) – Analysis name

  • dataset_id (int) – Dataset ID

  • kwargs (dict) – kwargs to set as class attributes

Methods

__init__(*, analyses, name, dataset_id, **kwargs)

Initate a new Analysis object.

clone([dataset_id])

Clone current analysis.

fill([partial, dryrun])

Fill missing fields

get_full()

Get full analysis representation

get_resources()

Get analysis resources

get_status()

Get compilation status

pull()

Pull updates from API, overriding changes made locally

push()

Push changes from to API, and sync with returned results

clone(dataset_id=None)

Clone current analysis. If dataset_id is provided, new run and predictor_ids will be filled for that dataset.

Parameters:

dataset_id (int) – Dataset ID

Returns:

Analysis instance.

Rype:

Analysis

fill(partial=True, dryrun=False)

Fill missing fields

Parameters:
  • id (str) – Analysis hash_id

  • partial (bool) – Partial fill.

  • dryrun (bool) – Do not commit to database.

Returns:

Requests response object

Rype:

requests.Response

get_full()

Get full analysis representation

get_resources()

Get analysis resources

get_status()

Get compilation status

pull()

Pull updates from API, overriding changes made locally

push()

Push changes from to API, and sync with returned results