psdi-data-conversion 0.2.0__py3-none-any.whl → 0.2.1__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.
@@ -151,7 +151,7 @@ QUAL_CONN_LABEL = "Atomic connections are"
151
151
  QUAL_2D_KEY = "two_dim"
152
152
  QUAL_2D_LABEL = "2D atomic coordinates are"
153
153
  QUAL_3D_KEY = "three_dim"
154
- QUAL_3D_LABEL = "2D atomic coordinates are"
154
+ QUAL_3D_LABEL = "3D atomic coordinates are"
155
155
 
156
156
  # Notes for conversion quality
157
157
  QUAL_NOTE_IN_UNKNOWN = ("Potential data extrapolation: {} represented in the output format but its representation in "
@@ -9,12 +9,14 @@ from __future__ import annotations
9
9
 
10
10
  import json
11
11
  import os
12
+ import sys
12
13
  from copy import copy
13
14
  from dataclasses import dataclass, field
14
15
  from functools import lru_cache
15
16
  from itertools import product
16
17
  from logging import getLogger
17
18
  from typing import Any, Literal, overload
19
+ from warnings import catch_warnings
18
20
 
19
21
  import igraph as ig
20
22
 
@@ -863,12 +865,18 @@ class ConversionsTable:
863
865
  # TODO: When there's some better measure of conversion quality, use it to choose which converter to use
864
866
  return [l_possible_direct_conversions[0]]
865
867
 
866
- # Query the graph for the shortest paths to perform this conversion
867
868
  graph: ig.Graph = self._get_desired_graph(only)
868
- l_paths: list[list[int]] = graph.get_shortest_paths(in_format_info.id, to=out_format_info.id)
869
+
870
+ # Query the graph for the shortest paths to perform this conversion. If no conversions are possible, igraph
871
+ # will print a warning, which we catch and suppress here
872
+ with catch_warnings(record=True) as l_warnings:
873
+ l_paths: list[list[int]] = graph.get_shortest_paths(in_format_info.id, to=out_format_info.id)
874
+ for warning in l_warnings:
875
+ if "Couldn't reach some vertices" not in str(warning.message):
876
+ print(warning, file=sys.stderr)
869
877
 
870
878
  # Check if any paths are possible
871
- if not l_paths:
879
+ if not l_paths or not l_paths[0]:
872
880
  return None
873
881
 
874
882
  # Check each path to find the first which doesn't lose any unnecessary info, or else the one which loses the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psdi_data_conversion
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Chemistry file format conversion service, provided by PSDI
5
5
  Project-URL: Homepage, https://data-conversion.psdi.ac.uk/
6
6
  Project-URL: Documentation, https://psdi-uk.github.io/psdi-data-conversion/
@@ -241,6 +241,8 @@ Requires-Dist: pytest; extra == 'gui-test'
241
241
  Requires-Dist: requests; extra == 'gui-test'
242
242
  Requires-Dist: selenium; extra == 'gui-test'
243
243
  Requires-Dist: webdriver-manager; extra == 'gui-test'
244
+ Provides-Extra: plots
245
+ Requires-Dist: matplotlib; extra == 'plots'
244
246
  Provides-Extra: test
245
247
  Requires-Dist: coverage; extra == 'test'
246
248
  Requires-Dist: pytest; extra == 'test'
@@ -251,7 +253,7 @@ Description-Content-Type: text/markdown
251
253
  [![License Badge](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
252
254
  ![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/brgillis/dbd938192dc4de9b7779978e515c0e79/raw/covbadge.json)
253
255
 
254
- Release date: 2024-04-29
256
+ Release date: 2024-06-03
255
257
 
256
258
  This is the repository for the PSDI PF2 Chemistry File Format Conversion project. The goal of this project is to provide utilities to assist in converting files between the many different file formats used in chemistry, providing information on what converters are available for a given conversion and the expected quality of it, and providing multiple interfaces to perform these conversions. These interfaces are:
257
259
 
@@ -1,8 +1,8 @@
1
1
  psdi_data_conversion/__init__.py,sha256=urMsTqsTHTch1q4rMT9dgGnrvdPFMP9B8r-6Kr8H5sE,404
2
2
  psdi_data_conversion/app.py,sha256=VmZlIAZ_J9W6p_WUcTA_2UNmZxssmq1aT72I2d1ObDc,3606
3
- psdi_data_conversion/constants.py,sha256=w-P3QrS2MQm3gorqZfKqX15YhOTvqZSZ7h6pdxwlzao,7348
3
+ psdi_data_conversion/constants.py,sha256=eXE43_9YFahoehiUV7FtqN9MKb-UpSfY2win9ic9W8I,7348
4
4
  psdi_data_conversion/converter.py,sha256=OlwGKxI8nj76wrlVzP5S7fpXb6L-Ql8-mYLYGhW81Fk,27816
5
- psdi_data_conversion/database.py,sha256=86jxDXNnyo44lUg78IvwmhyoZaNzNCL9crSZbzcokm4,65284
5
+ psdi_data_conversion/database.py,sha256=7Xm5e8Wi3b2wGUh2soBZ4DdJ0PhVSXAvv1dVCXDhNQg,65685
6
6
  psdi_data_conversion/dist.py,sha256=LOcKEP7H7JA9teX1m-5awuBi69gmdhtUit7yxtCTOZ8,2293
7
7
  psdi_data_conversion/file_io.py,sha256=LvdPmnYL_7Xlcr-7LJjUbbky4gKiqTTvPRzdbtvQaJo,8794
8
8
  psdi_data_conversion/log_utility.py,sha256=CHAq-JvBnTKaE0SHK5hM5j2dTbfSli4iUc3hsf6dBhc,8789
@@ -87,8 +87,8 @@ psdi_data_conversion/testing/conversion_callbacks.py,sha256=ATR-_BsYCUN8KyOyUjfd
87
87
  psdi_data_conversion/testing/conversion_test_specs.py,sha256=PFzTZYonQ0PsZBKjcn0Hp-UPbwphT3zRH5v-VdNImmQ,27585
88
88
  psdi_data_conversion/testing/gui.py,sha256=ul7ixYANIzmOG2ZNOZmQO6wsHmGHdiBGAlw-KuoN0j8,19085
89
89
  psdi_data_conversion/testing/utils.py,sha256=A2CDiGr4Gah1eRvGwFmHt1m0F7RdXOxzCuTyYhcAIR4,26122
90
- psdi_data_conversion-0.2.0.dist-info/METADATA,sha256=_GG0nAM1Dm9QdA5DW9UZVPWf9izJNgwKqj7OeNfy9pU,48472
91
- psdi_data_conversion-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- psdi_data_conversion-0.2.0.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
93
- psdi_data_conversion-0.2.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
- psdi_data_conversion-0.2.0.dist-info/RECORD,,
90
+ psdi_data_conversion-0.2.1.dist-info/METADATA,sha256=jv8iuV3VSQz_4NzFcG5bvTSzO5Ib7WysLqEWFYQ04NU,48538
91
+ psdi_data_conversion-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
+ psdi_data_conversion-0.2.1.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
93
+ psdi_data_conversion-0.2.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
+ psdi_data_conversion-0.2.1.dist-info/RECORD,,