Skip to content

Commit 6a8d62e

Browse files
authored
Merge pull request #444 from ssl-hep/doc_week
Overhaul of ServiceX Docs for 3.0 release
2 parents 55d44f0 + 2d248b1 commit 6a8d62e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+991
-688
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
deploy:
5757
name: Deploy docs to GitHub Pages
58-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/3.0_develop')
58+
if: github.event_name == 'push'
5959
needs: build
6060
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
6161
permissions:

.readthedocs.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,24 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
python: "3.12"
12-
# You can also specify other tool versions:
13-
# nodejs: "20"
14-
# rust: "1.70"
15-
# golang: "1.20"
1612

1713
# Build documentation in the "docs/" directory with Sphinx
1814
sphinx:
1915
configuration: docs/conf.py
20-
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
16+
# # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
2117
builder: html
2218
# Fail on all warnings to avoid broken references
2319
# fail_on_warning: true
2420

2521
# Optionally build your docs in additional formats such as PDF and ePub
2622
formats:
2723
- pdf
28-
# - epub
2924

3025
# Optional but recommended, declare the Python requirements required
3126
# to build your documentation
3227
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3328
python:
3429
install:
35-
- requirements: docs/requirements.txt
3630
- method: pip
3731
path: .
3832
extra_requirements:

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
"nqueries",
5656
"ntuples",
5757
"numpy",
58+
"opendata",
5859
"pathlib",
60+
"PHYSLITE",
5961
"pnfs",
6062
"posix",
6163
"Powheg",
@@ -94,6 +96,7 @@
9496
"unittests",
9597
"URL's",
9698
"xaod",
99+
"xaodr",
97100
"xrootd"
98101
],
99102
"python.analysis.typeCheckingMode": "basic",

README.md

Lines changed: 3 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,7 @@
1-
# servicex_client
1+
# ServiceX Client Library
22
Python SDK and CLI Client for ServiceX
33

4-
## Configuration
5-
The client relies on a YAML file to obtain the URLs of different servicex
6-
deployments, as well as tokens to authenticate with the service. The file
7-
should be named `.servicex` and the format of this file is as follows:
8-
```yaml
9-
api_endpoints:
10-
- endpoint: http://localhost:5000
11-
name: localhost
4+
## Documentation
5+
The development documentation is hosted at https://servicex-frontend.readthedocs.io
126

13-
- endpoint: https://servicex-release-testing-4.servicex.ssl-hep.org
14-
name: testing4
15-
token: ...
16-
17-
default_endpoint: testing4
18-
19-
cache_path: /tmp/ServiceX_Client/cache-dir
20-
shortened_downloaded_filename: true
21-
22-
```
23-
The `default_endpoint` will be used if otherwise not specified. The cache
24-
database and downloaded files will be stored in the directory specified by
25-
`cache_path`.
26-
27-
The `shortened_downloaded_filename` property controls whether downloaded files
28-
will have their names shortened for convenience. Setting to false preserves
29-
the full filename from the dataset.
30-
`
31-
32-
The library will search for this file in the current working directory and then
33-
start looking in parent directories until a file is found.
34-
35-
## Command Line Interface
36-
When installed, the client provides a new command in your shell, `servicex`.
37-
This command uses a series of subcommands to work with various functions of
38-
serviceX.
39-
40-
Common command line arguments:
41-
42-
| Flag | Long Flag | What it does |
43-
|------|-----------|------------------------------------------------------|
44-
| -u | --url | The url of the serviceX ingress |
45-
| -b | --backend | Named backend from the .servicex file endpoints list |
46-
47-
If neither url nor backend are specified then the client will attempt to use the
48-
`default_endpoint` value to determine who to talk to.
49-
50-
### codegens
51-
This command will list the code generators deployed.
52-
53-
### transforms
54-
These commands interact with transforms that have been run
55-
56-
#### list
57-
List transforms associated with the current user. Add the `--complete` flag to
58-
only show transforms that have completed.
59-
60-
#### files
61-
List the files along with their size generated by a transform. Specify the
62-
transform request id with the `-t` or `--transform-id` flag
63-
64-
#### download
65-
Download the files from a transform to a local directory. Specify the transform
66-
request id with `-t` and the directory to download to with `-d`. Defaults to
67-
downloading files to the current working directory.
68-
69-
### cache
70-
These commands allow you to work with the query cache maintained by the serviceX
71-
client.
72-
73-
#### list
74-
Show all of the cached transforms along with the run time, code generator, and
75-
number of resulting files
76-
77-
#### delete
78-
Delete a specific transform from the cache. Provide the transform request ID
79-
with the `-t` or `--transform-id` arg.
80-
81-
#### clear
82-
Clear all of the transforms from the cache. Add `-y` to force the operation
83-
without confirming with the console.
84-
85-
## Python SDK
86-
Entry to the SDK starts with constructing an instance of ServiceXClient. The
87-
constructor accepts `backend` argument to specify a named backend from the
88-
`.servicex` file, or `url` for the direct URL to a serviceX server. With the
89-
URL option you can't provide a token from `.servicex` so it must either be an
90-
unsecured endpoint, or the token must be provided via the WLCG standard of a
91-
file pointed to by `BEARER_TOKEN_FILE` environment variable.
92-
93-
With an instance of ServiceXClient you can
94-
- List the code generators deployed with the ServiceX instance
95-
- List the transformers that have been run
96-
- Get the current status of a specific transform
97-
98-
### Create a Dataset Instance to Run Transforms
99-
The ServiceX client also can create a `Dataset` instance that
100-
allows you to specify a query, provide a dataset identifier,
101-
and retrieve the results of the resulting transform request.
102-
103-
There are two types of datasets
104-
- func_adl_dataset
105-
- Python Function dataset
106-
107-
### Dataset Identifiers
108-
Before we get too deeply into the dataset classes, we should look
109-
at how to specify a dataset.
110-
- RucioDatasetIdentifier - for retrieving data files registered with Rucio
111-
- FileListDataset - A list of URIs for accessing files using xRootd
112-
113-
### FuncADL Dataset
114-
This dataset is controlled by the func_adl language. The dataset
115-
supports the `Select`, `SelectMany`, `Where`, `MetaData`, and `QMetaData`
116-
operators from func_adl.
117-
118-
119-
### Datasets
120-
This is the abstract class for requesting data from ServiceX. You have to
121-
specify the dataset identifier you want data from and provide some sort of
122-
selection query. You can set the result format with the `set_result_format`
123-
operator (it's also a factory method arg for the dataset).
124-
125-
Operators that cause the client to interact with the server: These terminal
126-
operators will call out to the serviceX server and process results. They
127-
are all implemented as asynchronous coroutines, but they also come with
128-
synchronous versions to make it easy to do easy things.
129-
130-
131-
####
1327

docs/command_line.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Command Line Interface
2+
=======================
3+
*\*Experimental*
4+
5+
The command line interface (CLI) is a text-based interface used to interact with the system.
6+
When installed, the client provides a new command in your shell,
7+
``servicex``. This command uses a series of subcommands to work with
8+
various functions of serviceX.
9+
10+
Common command line arguments:
11+
12+
+-----+----------+-----------------------------------------------------+
13+
| F | Long | What it does |
14+
| lag | Flag | |
15+
+=====+==========+=====================================================+
16+
| -u | –url | The url of the serviceX ingress |
17+
+-----+----------+-----------------------------------------------------+
18+
| -b | –backend | Named backend from the .servicex file endpoints |
19+
| | | list |
20+
+-----+----------+-----------------------------------------------------+
21+
22+
If neither url nor backend are specified then the client will attempt to
23+
use the ``default_endpoint`` value to determine who to talk to.
24+
25+
codegens
26+
~~~~~~~~
27+
28+
This command will list the code generators deployed.
29+
30+
transforms
31+
~~~~~~~~~~
32+
33+
These commands interact with transforms that have been run
34+
35+
list
36+
^^^^
37+
38+
List transforms associated with the current user. Add the ``--complete``
39+
flag to only show transforms that have completed.
40+
41+
files
42+
^^^^^
43+
44+
List the files along with their size generated by a transform. Specify
45+
the transform request id with the ``-t`` or ``--transform-id`` flag
46+
47+
download
48+
^^^^^^^^
49+
50+
Download the files from a transform to a local directory. Specify the
51+
transform request id with ``-t`` and the directory to download to with
52+
``-d``. Defaults to downloading files to the current working directory.
53+
54+
cache
55+
~~~~~
56+
57+
These commands allow you to work with the query cache maintained by the
58+
serviceX client.
59+
60+
61+
list
62+
^^^^
63+
64+
Show all of the cached transforms along with the run time, code
65+
generator, and number of resulting files
66+
67+
delete
68+
^^^^^^
69+
70+
Delete a specific transform from the cache. Provide the transform
71+
request ID with the ``-t`` or ``--transform-id`` arg.
72+
73+
clear
74+
^^^^^
75+
76+
Clear all of the transforms from the cache. Add ``-y`` to force the
77+
operation without confirming with the console.
78+

docs/conf.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# sys.path.insert(0, os.path.abspath(".."))
1212

1313

14-
project = 'ServiceX Client'
15-
copyright = '2023, Ben Galewsky, Gordon Watts'
16-
author = 'Ben Galewsky, Gordon Watts'
14+
project = 'ServiceX'
15+
copyright = '2024 Institute for Research and Innovation in Software for High Energy Physics (IRIS-HEP)' # NOQA 501
16+
author = 'Ben Galewsky, Gordon Watts, KyongEon Choi, Ketan Mahajan, Peter Onyisi'
1717
release = '3.0.0'
1818

1919
# -- General configuration ---------------------------------------------------
@@ -25,15 +25,26 @@
2525
'sphinx.ext.viewcode',
2626
'sphinx.ext.doctest',
2727
'code_include.extension',
28-
'myst_parser'
28+
'myst_parser',
29+
'sphinxcontrib.autodoc_pydantic',
30+
'sphinx_tabs.tabs'
2931
]
3032

3133
templates_path = ['_templates']
32-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
34+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'examples']
3335

3436
autoclass_content = 'both'
3537

36-
38+
autodoc_pydantic_model_show_json = False
39+
autodoc_pydantic_field_list_validators = False
40+
autodoc_pydantic_config_members = False
41+
autodoc_pydantic_model_members = False
42+
autodoc_pydantic_model_show_config_summary = False
43+
autodoc_pydantic_model_show_field_summary = False
44+
autodoc_pydantic_model_undoc_members = False
45+
autodoc_pydantic_settings_show_validator_summary = False
46+
autodoc_pydantic_settings_show_validator_members = False
47+
autodoc_pydantic_model_member_order = 'bysource'
3748
# -- Options for HTML output -------------------------------------------------
3849
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3950

docs/config_Uproot_FuncADL.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)