Skip to content

Commit

Permalink
Merge pull request #74 from pyscal/relax_requirements
Browse files Browse the repository at this point in the history
Relax requirements
  • Loading branch information
srmnitc authored Apr 9, 2024
2 parents 5c8f014 + 60bacf4 commit d0f96fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 0 additions & 2 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ dependencies:
- networkx
- pandas
- owlready2
- sqlalchemy <2.0.0
- rdflib-sqlalchemy
- jupyter-book
- plotly
- ipywidgets
Expand Down
2 changes: 0 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ dependencies:
- networkx
- pandas
- owlready2
- sqlalchemy <2.0.0
- rdflib-sqlalchemy
- plotly
- ipywidgets
16 changes: 14 additions & 2 deletions pyscal_rdf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from rdflib import Graph, Literal, Namespace, XSD, RDF, RDFS, BNode, URIRef, FOAF, SKOS, DCTERMS
from rdflib.store import NO_STORE, VALID_STORE
from rdflib import plugin

import os
import numpy as np
Expand Down Expand Up @@ -93,13 +94,24 @@ def __init__(self, graph_file=None,


elif store=="SQLAlchemy":
#check for modules
try:
import sqlalchemy as sa
except ImportError:
raise RuntimeError('Please install the sqlalchemy package')
try:
import rdflib_sqlalchemy as rsa
except ImportError:
raise RuntimeError('Please install the rdllib-sqlalchemy package. The development version is needed, please do pip install git+https://github.com/RDFLib/rdflib-sqlalchemy.git@develop')

if store_file is None:
raise ValueError("store file is needed if store is not memory")
self.graph = Graph(store="SQLAlchemy", identifier=identifier)

self.graph = Graph(store="SQLAlchemy", identifier=identifier)
uri = Literal(f"sqlite:///{store_file}")
self.graph.open(uri, create=True)
else:
raise ValueError("store should be pyiron_project, SQLAlchemy, or Memory")
raise ValueError("Memory or SQLAlchemy")

#start the storage
self.structure_store = _setup_structure_store(self.structure_store)
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ rdflib
pyyaml
graphviz
networkx
ipycytoscape
pyscal3
spglib
rdflib-sqlalchemy
sqlalchemy<2.0.0
pandas
owlready2

0 comments on commit d0f96fe

Please sign in to comment.