dmagic.scheduling

Module containing routines to access the APS scheduling system.

You must create in your home directory a scheduling.ini configuration file

Functions:

beamtime_requests(run, auth, args)

Get a dictionary-like object with all proposals that have a beamtime request scheduled during the run.

current_run(auth, args)

Determine the current run

get_current_emails(proposal[, exclude_pi])

Find user's emails listed in the currently active proposal

get_current_pi(proposal)

Get information about the currently active proposal PI.

get_current_proposal(proposals, args)

Get a dictionary-like object with currently active proposal information.

get_current_proposal_id(proposal)

Get the proposal id for the currently active proposal.

get_current_proposal_title(proposal)

Get the title of the currently active proposal.

get_current_users(proposal)

Get users listed in the currently active proposal.

dmagic.scheduling.beamtime_requests(run, auth, args)[source]

Get a dictionary-like object with all proposals that have a beamtime request scheduled during the run. If no proposal is active or auth does not have permission for beamline, return None.

Parameters
  • run (string) – Run name e.g. ‘2024-1’

  • auth (Basic http authorization object) – Basic http authorization.

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

Returns

proposals (list) – dict-like object with proposals that have a beamtime request scheduled during the run. Returns None if there are no proposals or if auth does not have permission for beamline.

dmagic.scheduling.current_run(auth, args)[source]

Determine the current run

Parameters

auth (Basic http authorization object) – Basic http authorization.

Returns

run (string) – Run name 2024-1.

dmagic.scheduling.get_current_emails(proposal, exclude_pi=True)[source]

Find user’s emails listed in the currently active proposal

Parameters

proposal (dictionary-like object containing proposal information)

Returns

List of user emails (default (all but PI))

dmagic.scheduling.get_current_pi(proposal)[source]

Get information about the currently active proposal PI.

Parameters

proposal (dictionary-like object containing proposal information)

Returns

dictionary-like object containing PI information

dmagic.scheduling.get_current_proposal(proposals, args)[source]

Get a dictionary-like object with currently active proposal information. If no proposal is active, return None

Parameters

proposal (dictionary-like object containing proposal information)

Returns

dict-like object with information for currently active proposal

dmagic.scheduling.get_current_proposal_id(proposal)[source]

Get the proposal id for the currently active proposal.

Parameters

proposal (dictionary-like object containing proposal information)

Returns

currently active proposal ID as an int

dmagic.scheduling.get_current_proposal_title(proposal)[source]

Get the title of the currently active proposal.

Parameters

proposal (dictionary-like object containing proposal information)

Returns

str (title of the currently active proposal)

dmagic.scheduling.get_current_users(proposal)[source]

Get users listed in the currently active proposal.

Parameters

proposal (dictionary-like object containing proposal information)

Returns

users (dictionary-like object containing user information)