Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions examples/Uproot_UprootRaw_Dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ def uproot_uproot_raw_dict():
query = UprootRaw([{"treename": "reco", "filter_name": "el_pt_NOSYS"}])

spec = {
'General': {
'ServiceX': "servicex-uc-af"
},
'Sample': [{
'Name': "Uproot_PythonFunction_Dict",
'RucioDID': "user.mtost:user.mtost.singletop.p6026.Jun13",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ develop = [
"servicex[databinder,pandas,test,docs]",
]

[project.entry-points.'servicex.queries']
[project.entry-points.'servicex.query']
FuncADL_Uproot = "servicex.func_adl.func_adl_dataset:FuncADLQuery_Uproot"
FuncADL_ATLASr21 = "servicex.func_adl.func_adl_dataset:FuncADLQuery_ATLASr21"
FuncADL_ATLASr22 = "servicex.func_adl.func_adl_dataset:FuncADLQuery_ATLASr22"
Expand Down
7 changes: 4 additions & 3 deletions servicex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
from servicex.uproot_raw.uproot_raw import UprootRawQuery as UprootRaw
from servicex.python_dataset import PythonQuery as PythonFunction
from servicex.servicex_client import ServiceXClient, deliver
from .query import Query
from .query_core import Query
from .models import ResultFormat, ResultDestination
from .dataset_group import DatasetGroup
from .dataset_identifier import RucioDatasetIdentifier, FileListDataset

from . import query

__all__ = [
"ServiceXClient",
Expand All @@ -59,5 +59,6 @@
"General",
"DefinitionList",
"ServiceXSpec",
"deliver"
"deliver",
"query"
]
2 changes: 1 addition & 1 deletion servicex/databinder_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)

from servicex.dataset_identifier import RucioDatasetIdentifier, FileListDataset
from servicex.query import Query as SXQuery, QueryStringGenerator
from servicex.query_core import Query as SXQuery, QueryStringGenerator
from servicex.models import ResultFormat


Expand Down
2 changes: 1 addition & 1 deletion servicex/dataset_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from rich.progress import Progress

from servicex.query import Query
from servicex.query_core import Query
from servicex.expandable_progress import ExpandableProgress
from servicex.func_adl.func_adl_dataset import FuncADLQuery
from servicex.models import TransformedResults, ResultFormat
Expand Down
2 changes: 1 addition & 1 deletion servicex/func_adl/func_adl_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from func_adl import EventDataset, find_EventDataset
from func_adl.object_stream import S
from servicex.configuration import Configuration
from servicex.query import Query
from servicex.query_core import Query
from servicex.func_adl.util import has_tuple
from servicex.models import ResultFormat
from servicex.query_cache import QueryCache
Expand Down
2 changes: 1 addition & 1 deletion servicex/python_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from base64 import b64encode

from servicex.configuration import Configuration
from servicex.query import Query
from servicex.query_core import Query
from servicex.models import ResultFormat
from servicex.query_cache import QueryCache
from servicex.servicex_adapter import ServiceXAdapter
Expand Down
38 changes: 38 additions & 0 deletions servicex/query/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2024, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points

plugins = entry_points(group='servicex.query')
for _ in plugins:
globals()[_.name] = _.load()
File renamed without changes.
4 changes: 2 additions & 2 deletions servicex/servicex_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from servicex.models import ResultFormat, TransformStatus, TransformedResults
from servicex.query_cache import QueryCache
from servicex.servicex_adapter import ServiceXAdapter
from servicex.query import (
from servicex.query_core import (
GenericQuery,
QueryStringGenerator,
GenericQueryStringGenerator,
Expand Down Expand Up @@ -76,7 +76,7 @@ def _load_ServiceXSpec(
else:
from importlib.metadata import entry_points

plugins = entry_points(group="servicex.queries")
plugins = entry_points(group="servicex.query")
for _ in plugins:
yaml.register_class(_.load())

Expand Down
2 changes: 1 addition & 1 deletion servicex/uproot_raw/uproot_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import pydantic
from typing import List, Union, Mapping, Optional, get_args
from ..query import QueryStringGenerator
from ..query_core import QueryStringGenerator


class TreeSubQuery(pydantic.BaseModel):
Expand Down
5 changes: 5 additions & 0 deletions tests/test_databinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,8 @@ def test_generic_query(codegen_list):
# no codegen specified by generic class
query = sx.generic_query(dataset_identifier=spec.Sample[0].RucioDID,
query=spec.Sample[0].Query)


def test_entrypoint_import():
""" This will check that we have at least the Python transformer defined in servicex.query """
from servicex.query import PythonFunction # noqa
2 changes: 1 addition & 1 deletion tests/test_servicex_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from servicex.models import (TransformStatus, Status, ResultFile, ResultFormat,
TransformRequest, TransformedResults)
from servicex.query_cache import QueryCache
from servicex.query import ServiceXException
from servicex.query_core import ServiceXException
from servicex.servicex_client import ServiceXClient
from servicex.uproot_raw.uproot_raw import UprootRawQuery

Expand Down