Skip to content

Commit

Permalink
disable SqliteStorageManager
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhb committed Jul 16, 2024
1 parent fc72d07 commit 32a2968
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion oc_ds_converter/oc_idmanager/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from requests.exceptions import ConnectionError
from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
#from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Optional, Type, Callable


Expand Down
3 changes: 1 addition & 2 deletions oc_ds_converter/oc_idmanager/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from oc_ds_converter.metadata_manager import MetadataManager
from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
# from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Optional, Type, Tuple


Expand Down Expand Up @@ -220,4 +220,3 @@ def exists(self, doi_full, get_extra_info=False, allow_extra_api=None):
else:
return (False, {'id': None, 'valid': False, 'ra': 'unknown'}) if get_extra_info else False
return (valid_bool, {'id': doi, 'valid': valid_bool, 'ra': 'unknown'}) if get_extra_info else valid_bool

16 changes: 8 additions & 8 deletions oc_ds_converter/oc_idmanager/jid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from requests import ReadTimeout, get
from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
# from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Type, Optional


Expand Down Expand Up @@ -66,9 +66,9 @@ def is_valid(self, jid, get_extra_info=False):
self.storage_manager.set_value(jid, validity_check)

return validity_check





def normalise(self, id_string, include_prefix=False):
"""It returns the jid normalized.
Expand All @@ -89,14 +89,14 @@ def normalise(self, id_string, include_prefix=False):
except:
# Any error in processing the JID will return None
return None

def syntax_ok(self, id_string):
if not id_string.startswith(self._p):
id_string = self._p+id_string
return True if match("^jid:[a-z]+([12][0-9]{3}){0,1}[a-z]*$", id_string) else False



def exists(self, jid_full, get_extra_info=False, allow_extra_api=None):
valid_bool = True
if self.use_api_service:
Expand Down Expand Up @@ -182,8 +182,8 @@ def exists(self, jid_full, get_extra_info=False, allow_extra_api=None):
if get_extra_info:
return valid_bool, {"valid": valid_bool}
return valid_bool


def extra_info(self, api_response, choose_api=None, info_dict={}):
result = {}
result["valid"] = True
Expand Down
2 changes: 1 addition & 1 deletion oc_ds_converter/oc_idmanager/orcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from requests.exceptions import ConnectionError
from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
#from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Type, Optional

# POSSIBLE EXTENSION: adding a new parameter in order to directly use the input orcid - doi map in the orcid manager
Expand Down
2 changes: 1 addition & 1 deletion oc_ds_converter/oc_idmanager/pmcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from requests.exceptions import ConnectionError
from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
#from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Type, Optional


Expand Down
2 changes: 1 addition & 1 deletion oc_ds_converter/oc_idmanager/pmid.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
#from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Optional, Type


Expand Down
2 changes: 1 addition & 1 deletion oc_ds_converter/oc_idmanager/viaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from oc_ds_converter.oc_idmanager.oc_data_storage.storage_manager import StorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.in_memory_manager import InMemoryStorageManager
from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
#from oc_ds_converter.oc_idmanager.oc_data_storage.sqlite_manager import SqliteStorageManager
from typing import Type, Optional


Expand Down

0 comments on commit 32a2968

Please sign in to comment.