biocypher 0.9.0__tar.gz → 0.9.1__tar.gz

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.

Potentially problematic release.


This version of biocypher might be problematic. Click here for more details.

Files changed (44) hide show
  1. {biocypher-0.9.0 → biocypher-0.9.1}/PKG-INFO +1 -1
  2. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_core.py +25 -4
  3. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_metadata.py +1 -1
  4. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_get_writer.py +1 -1
  5. {biocypher-0.9.0 → biocypher-0.9.1}/pyproject.toml +1 -1
  6. {biocypher-0.9.0 → biocypher-0.9.1}/LICENSE +0 -0
  7. {biocypher-0.9.0 → biocypher-0.9.1}/README.md +0 -0
  8. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/__init__.py +0 -0
  9. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/__init__.py +0 -0
  10. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/biocypher_config.yaml +0 -0
  11. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_config.yaml +0 -0
  12. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config.yaml +0 -0
  13. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config_disconnected.yaml +0 -0
  14. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config_extended.yaml +0 -0
  15. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_create.py +0 -0
  16. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_deduplicate.py +0 -0
  17. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_get.py +0 -0
  18. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_logger.py +0 -0
  19. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_mapping.py +0 -0
  20. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_misc.py +0 -0
  21. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_ontology.py +0 -0
  22. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_translate.py +0 -0
  23. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/__init__.py +0 -0
  24. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/__init__.py +0 -0
  25. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/_get_connector.py +0 -0
  26. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/_neo4j_driver.py +0 -0
  27. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/__init__.py +0 -0
  28. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_get_in_memory_kg.py +0 -0
  29. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_in_memory_kg.py +0 -0
  30. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_networkx.py +0 -0
  31. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_pandas.py +0 -0
  32. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/__init__.py +0 -0
  33. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_batch_writer.py +0 -0
  34. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_writer.py +0 -0
  35. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/__init__.py +0 -0
  36. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_arangodb.py +0 -0
  37. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_neo4j.py +0 -0
  38. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_networkx.py +0 -0
  39. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_owl.py +0 -0
  40. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_rdf.py +0 -0
  41. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/__init__.py +0 -0
  42. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_csv.py +0 -0
  43. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_postgresql.py +0 -0
  44. {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_sqlite.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biocypher
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: A unifying framework for biomedical research knowledge graphs
5
5
  Home-page: https://github.com/biocypher/biocypher
6
6
  License: MIT
@@ -118,6 +118,15 @@ class BioCypher:
118
118
  else:
119
119
  self._offline = offline
120
120
 
121
+ # Check if pandas/tabular is being used in offline mode
122
+ if self._offline and self._dbms.lower() in ["pandas", "tabular"]:
123
+ msg = (
124
+ f"The '{self._dbms}' DBMS is only available in online mode. "
125
+ f"If you want to write CSV files, use 'csv' as the DBMS. "
126
+ f"If you want to use pandas, set 'offline: false' in your configuration."
127
+ )
128
+ raise ValueError(msg)
129
+
121
130
  if strict_mode is None:
122
131
  self._strict_mode = self.base_config["strict_mode"]
123
132
  else:
@@ -225,19 +234,31 @@ class BioCypher:
225
234
  The knowledge graph is returned based on the `dbms` parameter in
226
235
  the biocypher configuration file.
227
236
 
237
+ TODO: These conditionals are a hack, we need to refactor the in-memory
238
+ KG to be generic, and simplify access and conversion to output formats.
239
+
228
240
  Returns
229
241
  -------
230
242
  Any: knowledge graph.
231
243
 
232
244
  """
245
+ # If we're using an in-memory KG and it already exists, return it directly
246
+ if self._in_memory_kg and self._is_online_and_in_memory():
247
+ return self._in_memory_kg.get_kg()
248
+
249
+ # Otherwise, initialize and populate the in-memory KG
233
250
  if not self._in_memory_kg:
234
251
  self._initialize_in_memory_kg()
235
252
  if not self._translator:
236
253
  self._get_translator()
237
- tnodes = self._translator.translate_entities(self._nodes)
238
- tedges = self._translator.translate_entities(self._edges)
239
- self._in_memory_kg.add_nodes(tnodes)
240
- self._in_memory_kg.add_edges(tedges)
254
+
255
+ # These attributes might not exist when using in-memory KG directly
256
+ if hasattr(self, "_nodes") and hasattr(self, "_edges"):
257
+ tnodes = self._translator.translate_entities(self._nodes)
258
+ tedges = self._translator.translate_entities(self._edges)
259
+ self._in_memory_kg.add_nodes(tnodes)
260
+ self._in_memory_kg.add_edges(tedges)
261
+
241
262
  return self._in_memory_kg.get_kg()
242
263
 
243
264
  def _get_deduplicator(self) -> Deduplicator:
@@ -10,7 +10,7 @@ import pathlib
10
10
 
11
11
  import toml
12
12
 
13
- _VERSION = "0.9.0"
13
+ _VERSION = "0.9.1"
14
14
 
15
15
 
16
16
  def get_metadata():
@@ -75,7 +75,7 @@ def get_writer(
75
75
  instance: an instance of the selected writer class.
76
76
 
77
77
  """
78
- dbms_config = _config(dbms)
78
+ dbms_config = _config(dbms) or {}
79
79
 
80
80
  writer = DBMS_TO_CLASS[dbms]
81
81
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "biocypher"
3
- version = "0.9.0"
3
+ version = "0.9.1"
4
4
  description = "A unifying framework for biomedical research knowledge graphs"
5
5
  authors = [
6
6
  "Sebastian Lobentanzer <sebastian.lobentanzer@gmail.com>",
File without changes
File without changes
File without changes
File without changes