spectrochempy.Project

class Project(**kwargs)[source]

A manager for projects, datasets and scripts.

It can handle multiple datasets, subprojects, and scripts in a main project.

Parameters
  • *args (Series of objects, optional) – Argument type will be interpreted correctly if they are of type NDDataset , Project , or other objects such as Script . This is optional, as they can be added later.

  • argnames (list, optional) – If not None, this list gives the names associated to each object passed as args. It MUST be the same length that the number of args, or an error will be raised. If None, the internal name of each object will be used instead.

  • name (str, optional) – The name of the project. If the name is not provided, it will be generated automatically.

  • **meta (dict) – Any other attributes to describe the project.

See also

NDDataset

The main object containing arrays.

Script

Executables scripts container.

Examples

>>> myproj = scp.Project(name='project_1')
>>> ds = scp.NDDataset([1., 2., 3.], name='dataset_1')
>>> myproj.add_dataset(ds)
>>> print(myproj)
Project project_1:
    ⤷ dataset_1 (dataset)

Methods

Project.add_dataset(dataset[, name])

Add a single dataset to the current project.

Project.add_datasets(*datasets)

Add several datasets to the current project.

Project.add_project(proj[, name])

Add one project to the current project.

Project.add_projects(*projects)

Add one or a series of projects to the current project.

Project.add_script(script[, name])

Add one script to the current project.

Project.add_scripts(*scripts)

Add one or a series of scripts to the current project.

Project.copy()

Make an exact copy of the current project.

Project.dump(filename, **kwargs)

Save the current object into compressed native spectrochempy format.

Project.load(filename, **kwargs)

Open data from a '*.scp' (NDDataset) or '.pscp' (Project) file.

Project.remove_all_dataset()

Remove all dataset from the project.

Project.remove_all_project()

Remove all projects from the current project.

Project.remove_dataset(name)

Remove a dataset from the project.

Project.remove_project(name)

Remove one project from the current project.

Project.save(**kwargs)

Save the current object in SpectroChemPy format.

Project.save_as([filename])

Save the current NDDataset in SpectroChemPy format (*.scp).

Attributes

Project.allitems

All items contained in this project (list).

Project.allnames

Names of all objects contained in this project (list).

Project.datasets

Datasets included in this project excluding those located in subprojects (list).

Project.datasets_names

Names of all dataset included in this project.

Project.filename

Current filename for this dataset.

Project.filetype

Type of current file.

Project.id

Readonly object identifier (str).

Project.meta

Metadata for the project (meta).

Project.name

A user-friendly name for the project.

Project.parent

Instance of the Project which is the parent (if any) of the current project (project).

Project.projects

Subprojects included in this project (list).

Project.projects_names

Names of all subprojects included in this project (list).

Project.scripts

Scripts included in this project (list).

Project.scripts_names

Names of all scripts included in this project (list).

Project.suffix

Filename suffix.

allitems

All items contained in this project (list).

allnames

Names of all objects contained in this project (list).

datasets

Datasets included in this project excluding those located in subprojects (list).

datasets_names

Names of all dataset included in this project. (does not return those located in sub-folders) (list).

filename

Current filename for this dataset.

filetype

Type of current file.

id

Readonly object identifier (str).

meta

Metadata for the project (meta).

meta contains all attribute except the name, id and parent of the current project.

name

A user-friendly name for the project.

The default is automatically generated (str).

parent

Instance of the Project which is the parent (if any) of the current project (project).

projects

Subprojects included in this project (list).

projects_names

Names of all subprojects included in this project (list).

scripts

Scripts included in this project (list).

scripts_names

Names of all scripts included in this project (list).

suffix

Filename suffix.

Read Only property - automatically set when the filename is updated if it has a suffix, else give the default suffix for the given type of object.

Examples using spectrochempy.Project

Project creation

Project creation