|
1 | | -# MyMdC |
| 1 | +# EXtra-proposal |
2 | 2 |
|
3 | | -This package provides the `MyMdcProposal` class for easy access to MyMdC. |
| 3 | +A small Python library to work with European XFEL proposals: list runs, read |
| 4 | +metadata from MyMDC, open data with EXtra-data, access DAMNIT results, and make |
| 5 | +simple run timelines. |
| 6 | + |
| 7 | +## Install |
| 8 | + |
| 9 | +EXtra-proposal is available in our Python environment on the Maxwell cluster: |
| 10 | + |
| 11 | +```shell |
| 12 | +module load exfel exfel-python |
| 13 | +``` |
| 14 | + |
| 15 | +You can also install it from [from |
| 16 | +PyPI](https://pypi.org/project/extra-proposal/) to use in other environments |
| 17 | +with Python 3.9+: |
| 18 | + |
| 19 | +```shell |
| 20 | +pip install extra-proposal |
| 21 | + |
| 22 | +# Optional extras, installs: extra-data, damnit, pandas |
| 23 | +pip install "extra-proposal[extra]" |
| 24 | +``` |
| 25 | + |
| 26 | +## Quick start |
| 27 | + |
| 28 | +```python |
| 29 | +from extra_proposal import Proposal |
| 30 | + |
| 31 | +# Create a proposal object |
| 32 | +prop = Proposal(1234) |
| 33 | + |
| 34 | +print(prop.title()) # Proposal Title from MyMDC |
| 35 | +print(prop.runs()) # List runs found in /raw on disk |
| 36 | + |
| 37 | +# Per-run helpers |
| 38 | +print(prop[1].sample_name()) |
| 39 | +print(prop.run_type(1)) |
| 40 | +print(prop.run_techniques(1)) |
| 41 | + |
| 42 | +# Open data (requires EXtra-data) |
| 43 | +run = prop[1].data() |
| 44 | +# Open DAMNIT results (required damnit) |
| 45 | +damnit = prop[1].damnit() |
| 46 | + |
| 47 | +# Plot a simple timeline |
| 48 | +prop[1].plot_timeline() |
| 49 | +``` |
| 50 | + |
| 51 | +## Environment and auth |
| 52 | + |
| 53 | +By default MyMDC data is accessed using Zwop credentials stored under the |
| 54 | +proposal at `usr/mymdc-credentials.yml` (created automatically when available). |
| 55 | +It is possible to use your MyMdc |
| 56 | +[Oauth](https://in.xfel.eu/metadata/oauth/applications) credentials instead, in |
| 57 | +case ZWOP isn't available or the metadata endpoint isn't accessible through |
| 58 | +Zwop: |
| 59 | + |
| 60 | +```python |
| 61 | +Proposal(8034, user_id="...", user_secret="...", user_email="...") |
| 62 | +``` |
0 commit comments