NGPIris 5.7.0.dev1__py3-none-any.whl → 5.7.0.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,12 @@ from dataclasses import dataclass
2
2
  from typing import Literal
3
3
 
4
4
 
5
+ class WhiteSpaceInWildCardSearchError(Exception):
6
+ """
7
+ Error for when a whitespace is found in a wildcard search.
8
+ """
9
+
10
+
5
11
  @dataclass(frozen=True)
6
12
  class QueryString:
7
13
  """
@@ -51,7 +57,19 @@ class Field(QueryString):
51
57
  Method for turning a :py:class:`~NGPIris.hci.query_string.Field` into a
52
58
  string.
53
59
  """
54
- return self.field_name + ":" + '"' + str(self.value) + '"'
60
+ value = str(self.value)
61
+
62
+ # If a wildcard is used, then we can't format it as a Lucene term
63
+ if ("*" in value) or ("?" in value):
64
+ if " " in value:
65
+ msg = (
66
+ 'Whitespace was found in "'
67
+ + value
68
+ + '" which cannot be processed in a wildcard search'
69
+ )
70
+ raise WhiteSpaceInWildCardSearchError(msg)
71
+ return self.field_name + ":" + value
72
+ return self.field_name + ":" + '"' + value + '"'
55
73
 
56
74
 
57
75
  @dataclass(frozen=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: NGPIris
3
- Version: 5.7.0.dev1
3
+ Version: 5.7.0.dev3
4
4
  Author-email: Erik Brink <erik.brink@gu.se>, Sven Kristian Feddersen <sven.kristian.feddersen@gu.se>
5
5
  Requires-Python: >=3.14
6
6
  Description-Content-Type: text/markdown
@@ -14,6 +14,7 @@ Requires-Dist: ruff>=0.14.5
14
14
  Requires-Dist: tabulate>=0.9.0
15
15
  Requires-Dist: tqdm>=4.66.2
16
16
  Requires-Dist: urllib3==2.8.0
17
+ Requires-Dist: typing-extensions>=4.16.0
17
18
  Dynamic: license-file
18
19
 
19
20
  # NGP IRIS 👀
@@ -7,7 +7,7 @@ NGPIris/hci/exceptions.py,sha256=fLgJQet-zxXoLq4W1MJPE6HzvNwNC1TT3GApGaC8KOc,414
7
7
  NGPIris/hci/hci.py,sha256=5f0ERol5F5f5RH9HbQRaWm_ZvUXdhS9G2fkKKJRUyUs,8170
8
8
  NGPIris/hci/hci_api_requests.py,sha256=Zuj4ZMvjIqMlMvhiGxwA4STzy7at0hLjEqBB9FWgX3o,4700
9
9
  NGPIris/hci/helpers.py,sha256=bh8M3PBiMBNlE4tPdO9SPfvhYxPOOXJgbjQ0uQeZoOQ,2675
10
- NGPIris/hci/query_string.py,sha256=Fe11_cvevBJzHweVWSwJ4B1_F4Jghibub4XsR78nF_A,2761
10
+ NGPIris/hci/query_string.py,sha256=kiGNcCWhnZ_fOINNaXQAAL9uR_rArjd6gVXVB1b-3SA,3362
11
11
  NGPIris/hci/types.py,sha256=W8LflWJKDPudHZ0rIW2tdcaZ1zCOBJx2zPTv9ra3zXw,7987
12
12
  NGPIris/hcp/__init__.py,sha256=XcwyGKjCIBapkONvurw_sFNJC3EiYenJwRa4foS8unY,68
13
13
  NGPIris/hcp/exceptions.py,sha256=wgbLW4dfnjyxJkpdmi_aHawB2iIFX4LUYeinEWMjZP4,2460
@@ -20,9 +20,9 @@ NGPIris/parse_credentials/parse_credentials.py,sha256=meUCqTOpsBqTXS-tpN_JUxyvoU
20
20
  NGPIris/utils/__init__.py,sha256=MSJyKBuxCBYH7a7C03lO0D5d8exS3t2KTg-qJvWL08o,119
21
21
  NGPIris/utils/deprecation.py,sha256=RdG87CjBUpjWdTZUXWjXOTA4hvP_ItUb8JWkhYIExlA,1128
22
22
  NGPIris/utils/utils.py,sha256=FqJpQHDJmZk5Pafzm3sW6WfXvEi4sKCM463_pITMx_o,367
23
- ngpiris-5.7.0.dev1.dist-info/licenses/LICENSE,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
24
- ngpiris-5.7.0.dev1.dist-info/METADATA,sha256=lG2lBHjDErIZqdmG8KiThPL4j7hBWh__OuhahL8XOnM,6477
25
- ngpiris-5.7.0.dev1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
- ngpiris-5.7.0.dev1.dist-info/entry_points.txt,sha256=t8ADhe3ovPm9tW3XDZq1_vKmfHY98Ei_o6WioJobNzU,117
27
- ngpiris-5.7.0.dev1.dist-info/top_level.txt,sha256=954WCuIJkle_SMtr7MNPapiiLLAFhlKbcz6Bp89-2V0,8
28
- ngpiris-5.7.0.dev1.dist-info/RECORD,,
23
+ ngpiris-5.7.0.dev3.dist-info/licenses/LICENSE,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
24
+ ngpiris-5.7.0.dev3.dist-info/METADATA,sha256=ODCLYxgeeNILVzS6uorouW9oAZJNKeVd9w8jlXDnGSo,6518
25
+ ngpiris-5.7.0.dev3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
+ ngpiris-5.7.0.dev3.dist-info/entry_points.txt,sha256=t8ADhe3ovPm9tW3XDZq1_vKmfHY98Ei_o6WioJobNzU,117
27
+ ngpiris-5.7.0.dev3.dist-info/top_level.txt,sha256=954WCuIJkle_SMtr7MNPapiiLLAFhlKbcz6Bp89-2V0,8
28
+ ngpiris-5.7.0.dev3.dist-info/RECORD,,