atomscale.client#
Classes
|
Atomic Data Sciences API client |
- class atomscale.client.Client(api_key: str | None = None, endpoint: str | None = None, mute_bars: bool = False)[source]
Bases:
BaseClientAtomic Data Sciences API client
- Parameters:
api_key (str | None)
endpoint (str)
mute_bars (bool)
api_key – API key. Explicit value takes precedence; if None, falls back to AS_API_KEY environment variable.
endpoint – Root API endpoint. Explicit value takes precedence; if None, falls back to AS_API_ENDPOINT environment variable, defaulting to ‘https://api.atomscale.ai/’ if not set.
mute_bars – Whether to mute progress bars. Defaults to False.
- search(keywords: str | list[str] | None = None, include_organization_data: bool = True, data_ids: str | list[str] | None = None, physical_sample_ids: str | list[str] | None = None, project_ids: str | list[str] | None = None, data_type: Literal['rheed_image', 'rheed_stationary', 'rheed_rotating', 'xps', 'photoluminescence', 'pl', 'raman', 'recipe', 'all'] = 'all', status: Literal['success', 'pending', 'error', 'running', 'stream_active', 'stream_interrupted', 'stream_finalizing', 'stream_error', 'all'] = 'all', growth_length: tuple[int | None, int | None] = (None, None), upload_datetime: tuple[datetime | None, datetime | None] = (None, None), last_accessed_datetime: tuple[datetime | None, datetime | None] = (None, None)) DataFrame[source]
Search and obtain data catalogue entries
- Parameters:
keywords (str | list[str] | None) – Keyword or list of keywords to search all data catalogue fields with. This searching is applied after all other explicit filters. Defaults to None.
include_organization_data (bool) – Whether to include catalogue entries from other users in your organization. Defaults to True.
data_ids (str | list[str] | None) – Data ID or list of data IDs. Defaults to None.
physical_sample_ids (str | list[str] | None) – Physical sample ID or list of IDs. Defaults to None.
project_ids (str | list[str] | None) – Project ID or list of IDs. Defaults to None.
data_type (Literal["rheed_image", "rheed_stationary", "rheed_rotating", "xps", "photoluminescence", "raman", "all"]) – Type of data. Defaults to “all”.
status (Literal["success", "pending", "error", "running", "all"]) – Analyzed status of the data. Defaults to “all”.
growth_length (tuple[int | None, int | None]) – Minimum and maximum values of the growth length in seconds. Defaults to (None, None) which will include all non-video data.
upload_datetime (tuple[datetime | None, datetime | None]) – Minimum and maximum values of the upload datetime. Defaults to (None, None).
last_accessed_datetime (tuple[datetime | None, datetime | None]) – Minimum and maximum values of the last accessed datetime. Defaults to (None, None).
- Returns:
Pandas DataFrame containing matched entries in the data catalogue.
- Return type:
(DataFrame)
- get(data_ids: str | list[str]) list[RHEEDVideoResult | RHEEDImageResult | XPSResult | PhotoluminescenceResult | RamanResult | UnknownResult][source]
Get analyzed data results
- Parameters:
data_ids (str | list[str]) – Data ID or list of data IDs from the data catalogue to obtain analyzed results for.
- Returns:
List of result objects
- Return type:
list[atomscale.results.RHEEDVideoResult | atomscale.results.RHEEDImageResult | atomscale.results.XPSResult]
- list_physical_samples() DataFrame[source]
List physical samples available to the user.
- Return type:
DataFrame
- list_projects() DataFrame[source]
List projects available to the user.
- Return type:
DataFrame
- get_physical_sample(physical_sample_id: str, *, include_organization_data: bool = True, align: bool | str = False) PhysicalSampleResult[source]
Get all data for a physical sample.
- Parameters:
physical_sample_id (
str) – Identifier of the physical sample.include_organization_data (
bool) – Whether to include organization data. Defaults to True.align (
bool|str) – Whether to align timeseries data. If truthy, an aligned DataFrame is returned.
- Return type:
PhysicalSampleResult
- get_project(project_id: str, *, include_organization_data: bool = True, align: bool | str = False) ProjectResult[source]
Get all data grouped by physical sample for a project.
- Parameters:
project_id (
str) – Identifier of the project.include_organization_data (
bool) – Whether to include organization data. Defaults to True.align (
bool|str) – Whether to align timeseries at the project level. Defaults to False.
- Return type:
ProjectResult
- upload(files: list[str | BinaryIO])[source]
Upload and process files
- Parameters:
files (list[str | BinaryIO]) – List containing string paths to files, or BinaryIO objects from open.
- download_videos(data_ids: str | list[str], dest_dir: str | Path | None = None, data_type: Literal['raw', 'processed'] = 'processed')[source]
Download processed RHEED videos to disk.
- Parameters:
data_ids (str | list[str]) – One or more data IDs from the data catalogue.
dest_dir (str | Path | None) – Directory to write the files to. Defaults to the current working directory.
data_type (Literal["raw", "processed"]) – Whether to download raw or processed data.