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.
|
Content of a single beamtime request (proposal). |
|
Interact with the APS-U era beamline schedule system. |
Exceptions
Base for any exception from the scheduling server support. |
|
Incorrect or missing authentication details. |
|
Scheduling server is not allowed to respond to that request. |
|
Beamtime request (proposal) was not found. |
|
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.
- class apsbss.bss_is.IS_ScheduleSystem(dev=False)[source]#
Interact with the APS-U era beamline schedule system.
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.
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.
- property authorizedBeamlines#
Beamlines where these credentials are authorized.
- property beamlines#
List of all active beamlines, by name.
- 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.
- 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.