APS IS Scheduling System#

Credentials from the IS group are required for this interface. This interface provides more proposal details than the APS Data Management interface, such as:

  • Proposal type (general user proposal, partner user proposal, …)

  • Additional identifies, where applicable

  • Other content from original proposal, such as equipment details

Define the environment variable APSBSS_CREDS_FILE=/path/to/creds_file.txt where the creds_file.txt contains the username and password (separated by white space) authorized for access to these details. If the file so-described cannot be used, the DM interface will be used instead.

BSS_IS#

Support the APSU-era scheduling system restful web service from the IS group.

IS_BeamtimeRequest(raw, _run)

Content of a single beamtime request (proposal).

IS_ScheduleSystem([dev])

Interact with the APS-U era beamline schedule system.

Exceptions

IS_Exception

Base for any exception from the scheduling server support.

IS_MissingAuthentication

Incorrect or missing authentication details.

IS_NotAllowedToRespond

Scheduling server is not allowed to respond to that request.

IS_RequestNotFound

Beamtime request (proposal) was not found.

IS_Unauthorized

Credentials valid but not authorized to access.

https://beam-api-dev.aps.anl.gov/beamline-scheduling/swagger-ui/index.html

class apsbss.bss_is.IS_BeamtimeRequest(raw, _run)[source]#

Content of a single beamtime request (proposal).

property endDate: datetime#

Return the ending time of this proposal.

property info: dict#

Details provided with this proposal.

property proposal_id: str#

The proposal identifier.

property run: str#

The run identifier.

property startDate: datetime#

Return the starting time of this proposal.

property title: str#

The proposal title.

exception apsbss.bss_is.IS_Exception[source]#

Base for any exception from the scheduling server support.

exception apsbss.bss_is.IS_MissingAuthentication[source]#

Incorrect or missing authentication details.

exception apsbss.bss_is.IS_NotAllowedToRespond[source]#

Scheduling server is not allowed to respond to that request.

exception apsbss.bss_is.IS_RequestNotFound[source]#

Beamtime request (proposal) was not found.

class apsbss.bss_is.IS_ScheduleSystem(dev=False)[source]#

Interact with the APS-U era beamline schedule system.

activeBeamlines

Details about all active beamlines in database.

activities(beamline[, run])

An "activity" describes scheduled beamtime.

auth_from_creds(username, password)

Use credentials upplied as arguments.

auth_from_file(creds_file)

Use credentials from a text file.

beamlines

List of all active beamlines, by name.

current_proposal(beamline)

Return the current (active) proposal or 'None'.

current_run

All details about the current run.

get_request(beamline, proposal_id[, run])

Return the request (proposal) by beamline, id, and run.

proposals(beamline[, run])

Get all proposal (beamtime request) details for 'beamline' and 'run'.

runs

List of names of all known runs.

runsByDateTime([dateTime])

All details about runs in 'dateTime' (default to now).

runsByRunYear([year])

All details about runs in 'year' (default to this year).

webget(api)

Send 'api' request to server and GET its response.

property activeBeamlines#

Details about all active beamlines in database.

activities(beamline, run=None) dict[source]#

An “activity” describes scheduled beamtime.

auth_from_creds(username, password)[source]#

Use credentials upplied as arguments.

auth_from_file(creds_file)[source]#

Use credentials from a text file.

property authorizedBeamlines#

Beamlines where these credentials are authorized.

property beamlines#

List of all active beamlines, by name.

current_proposal(beamline: str)[source]#

Return the current (active) proposal or ‘None’.

get_request(beamline, proposal_id, run=None)[source]#

Return the request (proposal) by beamline, id, and run.

proposals(beamline: str, run: str = None) dict[source]#

Get all proposal (beamtime request) details for ‘beamline’ and ‘run’.

Credentials must match to the specific beamline.

Parameters#

beamlinestr

beamline ID as stored in the APS scheduling system, e.g. 2-BM-A,B or 7-BM-B or 32-ID-B,C

runstr

Run name e.g. ‘2024-1’. Default: name of the current run.

Returns#

proposalsdict

Dictionary of ‘BeamtimeRequest’ objects, keyed by proposal ID, scheduled on ‘beamline’ for ‘run’.

Raises#

IS_Exception :

Credentials are not authorized access to view beamtime requests (or proposals) from ‘beamline’.

runsByDateTime(dateTime=None)[source]#

All details about runs in ‘dateTime’ (default to now).

‘dateTime’ could be any of these types:

type

meaning

None

Default to the current time (in the local timezone).

str

ISO8601-formatted date and time representation: “2024-12-01T08:21:00-06:00”.

datetime

A ‘datetime.datetime’ object.

runsByRunYear(year=None)[source]#

All details about runs in ‘year’ (default to this year).

webget(api)[source]#

Send ‘api’ request to server and GET its response.

This is the low-level method to interact with the server, which requires authenticated access only. A custom AuthenticationError is raised if credentials have not been provided. Other custom exceptions could be raised, based on interpretation of the server’s response.

exception apsbss.bss_is.IS_Unauthorized[source]#

Credentials valid but not authorized to access.