File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11from nomad .config .models .plugins import APIEntryPoint
22
3+
34class MyAPIEntryPoint (APIEntryPoint ):
45
56 def load (self ):
@@ -11,4 +12,4 @@ def load(self):
1112 name = "ontology_service" ,
1213 description = "A service to provide ontological information for a given NeXus class." ,
1314 prefix = "/ontology_service" ,
14- )
15+ )
Original file line number Diff line number Diff line change 11######################################################################
22######################## import libraries ############################
33######################################################################
4- import os
54import logging
5+ import os
66import subprocess
7+
78import pygit2
9+
810os .environ ["OWLREADY2_JAVA_LOG_LEVEL" ] = "WARNING"
911
10- from nomad .config import config
1112from fastapi import FastAPI , HTTPException
12-
1313from fastapi .responses import RedirectResponse
14+ from nomad .config import config
1415from owlready2 import ThingClass , get_ontology , sync_reasoner
1516from owlready2 .namespace import Ontology
1617
3839
3940INFERRED_ONTOLOGY : Ontology | None = None
4041from threading import Lock
42+
4143ONTOLOGY_CACHE_LOCK = Lock ()
4244
4345def ensure_ontology_file ():
Original file line number Diff line number Diff line change 3939from toposort import toposort_flatten
4040
4141try :
42+ from nomad .config import config
4243 from nomad .datamodel import EntryArchive , EntryMetadata
4344 from nomad .datamodel .data import ArchiveSection , EntryData , Schema
4445 from nomad .datamodel .metainfo import basesections
7677 from nomad .normalizing .common import nomad_atoms_from_ase_atoms
7778 from nomad .normalizing .topology import add_system , add_system_info
7879 from nomad .utils import get_logger , hash , strip
79- from nomad .config import config
8080
8181except ImportError as exc :
8282 raise ImportError (
You can’t perform that action at this time.
0 commit comments