diff --git a/.docker/cert.sh b/.docker/cert.sh index e22cfba2995b5fd9d812232f562b7254233fe5b0..c7253c77d5ce60d17bd816b2ae012d176996f297 100755 --- a/.docker/cert.sh +++ b/.docker/cert.sh @@ -1,7 +1,7 @@ #!/bin/bash # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Daniel Hornung, Göttingen # diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65698d866d885e28c27c37b54372ae5fcb65a43f..f97022357bc5b5c08704853989c497e0edcf7f94 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/Makefile b/Makefile index 26f5c8182545b2a57b3921f3745d16ff6305a0cc..c53f7013c691efc4294bfc7391a0801b478bedd4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md index adeab4ddf8a321bdf4e2794f07f18f5c0f4425b3..11c8444601f05d98f7a5143a32bc645364731998 100644 --- a/RELEASE_GUIDELINES.md +++ b/RELEASE_GUIDELINES.md @@ -1,7 +1,7 @@ # Release Guidelines for the CaosDB Python Client Library This document specifies release guidelines in addition to the general release -guidelines of the CaosDB Project +guidelines of the LinkAhead project ([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md)) ## General Prerequisites diff --git a/extra/emacs/snippets/yaml-mode/RecordType b/extra/emacs/snippets/yaml-mode/RecordType index 6b4a9c263806b6d57442470a11a2770d3d417741..8c0382d5989355b7313ded8db084846cb52bfd38 100644 --- a/extra/emacs/snippets/yaml-mode/RecordType +++ b/extra/emacs/snippets/yaml-mode/RecordType @@ -1,5 +1,5 @@ # -*- mode: snippet -*- -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> diff --git a/integrationtests/clear_database.py b/integrationtests/clear_database.py index 138cf4e6abb256d5710cd2b32f55a1fb51f3fbed..b0b5020f580f7c31e1e56e262bbfa616abf52785 100644 --- a/integrationtests/clear_database.py +++ b/integrationtests/clear_database.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -23,7 +23,7 @@ # ** end header # """Clear the database before and after the integration tests.""" -import caosdb as db +import linkahead as db def clear_all(): diff --git a/integrationtests/crawl.py b/integrationtests/crawl.py index defed2cb4f5fb0a0f349898e555c5d25924e2f9b..a3e43a1954b62f83a62605348edc452135f21b99 100755 --- a/integrationtests/crawl.py +++ b/integrationtests/crawl.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,7 +28,7 @@ import logging import sys from argparse import RawTextHelpFormatter -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import fileguide from caosadvancedtools.crawler import FileCrawler from caosadvancedtools.guard import INSERT, UPDATE diff --git a/integrationtests/create_analysis.py b/integrationtests/create_analysis.py index 1b7aa0d2d6671f14a3c65cf5ed135dfecb0aa69c..ec2c707c8740c7ec2e7340fd6e1604d6d35d9c5c 100644 --- a/integrationtests/create_analysis.py +++ b/integrationtests/create_analysis.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -31,7 +31,7 @@ automated analysis pipeline. import sys from datetime import datetime -import caosdb as db +import linkahead as db def main(): diff --git a/integrationtests/example_hdf5cfood.py b/integrationtests/example_hdf5cfood.py index 5485402d2042b2055a087b99abcba409095a7c70..736885817f2116dbd31f6cb042906ea59e518318 100644 --- a/integrationtests/example_hdf5cfood.py +++ b/integrationtests/example_hdf5cfood.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 IndiScale GmbH <www.indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -27,7 +27,7 @@ An exemplary definition of a HDF5 CFood for integration testing """ -import caosdb as db +import linkahead as db from caosadvancedtools.cfoods.h5 import H5CFood from caosadvancedtools.scifolder import ExperimentCFood from caosadvancedtools.scifolder.generic_pattern import readme_pattern diff --git a/integrationtests/insert_model.py b/integrationtests/insert_model.py index 26bf478cdf0d3709e7c0c086fecf722b8c7f90fa..170adbc8a7fe3a3c20ee79b52994027bf6d132f9 100755 --- a/integrationtests/insert_model.py +++ b/integrationtests/insert_model.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import caosdb as db +import linkahead as db import h5py from caosadvancedtools.cfoods.h5 import H5CFood from caosadvancedtools.models.data_model import DataModel diff --git a/integrationtests/insert_some.py b/integrationtests/insert_some.py index cf16a45ddf1f95ed261af1d9f18edfa1cbf4b450..19a4c1f2a7e2f8664aa42cda8f4acc5f8b3c3ff5 100644 --- a/integrationtests/insert_some.py +++ b/integrationtests/insert_some.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import caosdb as db +import linkahead as db from caosadvancedtools.scifolder.experiment_cfood import dm # This inserts two identifiables. When no dependencies are possible among diff --git a/integrationtests/test_assure_functions.py b/integrationtests/test_assure_functions.py index e04d481f230936ae96b02fe910401f50e7138a01..91ec14401ef1772e9961acc9626ccd6ad9ac62a4 100644 --- a/integrationtests/test_assure_functions.py +++ b/integrationtests/test_assure_functions.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2021 University Medical Center Göttingen, Institute for Medical Informatics @@ -25,7 +25,7 @@ no `to_be_updated` is specified. """ -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (assure_object_is_in_list) from caosadvancedtools.guard import (global_guard, RETRIEVE, UPDATE) diff --git a/integrationtests/test_base_table_exporter_integration.py b/integrationtests/test_base_table_exporter_integration.py index 5af9caa3e83184f77c37c24073d85ee5aae2184b..286c4ac3a6a6f11d5c308892615579ea60ea89db 100644 --- a/integrationtests/test_base_table_exporter_integration.py +++ b/integrationtests/test_base_table_exporter_integration.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Sprecklelsen <f.spreckelsen@indiscale.com> @@ -22,7 +22,7 @@ # # ** end header # -import caosdb as db +import linkahead as db import pytest from caosadvancedtools import table_export as te diff --git a/integrationtests/test_cache.py b/integrationtests/test_cache.py index aacef1792e6028bf056093c517f45f6367f471d6..13470b8b0d523d1a30d3cf6895efabae3b245784 100644 --- a/integrationtests/test_cache.py +++ b/integrationtests/test_cache.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -26,7 +26,7 @@ import os import unittest from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db from caosadvancedtools.cache import UpdateCache diff --git a/integrationtests/test_crawl_with_datamodel_problems.py b/integrationtests/test_crawl_with_datamodel_problems.py index 8623d57d60ded38987953ffaf78b1d30e15a8011..c2b19a950fa86de07470e33d39064bdf23135720 100644 --- a/integrationtests/test_crawl_with_datamodel_problems.py +++ b/integrationtests/test_crawl_with_datamodel_problems.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (c) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (c) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -25,7 +25,7 @@ """ -import caosdb as db +import linkahead as db from caosadvancedtools import loadFiles from caosadvancedtools.cfood import fileguide from caosadvancedtools.crawler import FileCrawler diff --git a/integrationtests/test_crawler_basics.py b/integrationtests/test_crawler_basics.py index 60c09d73e954c39d752b5fa4ae5e272d28000ca1..04eb54599fa844e3b6b23295c809b4435bb465f4 100644 --- a/integrationtests/test_crawler_basics.py +++ b/integrationtests/test_crawler_basics.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -29,7 +29,7 @@ cfoods. This is tested in test_crawler_with_cfoods.py. """ import unittest -import caosdb as db +import linkahead as db from caosadvancedtools.crawler import Crawler from caosadvancedtools.guard import INSERT diff --git a/integrationtests/test_crawler_with_cfoods.py b/integrationtests/test_crawler_with_cfoods.py index 1fa5eaa5a4f050d7282b863aae626982ff738c43..472eee0eead393aa6c8b7634e0f9147b1b1f35a0 100755 --- a/integrationtests/test_crawler_with_cfoods.py +++ b/integrationtests/test_crawler_with_cfoods.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -25,8 +25,8 @@ import os import unittest -import caosdb as db -from caosdb.apiutils import retrieve_entity_with_id +import linkahead as db +from linkahead.apiutils import retrieve_entity_with_id def get_entity_with_id(eid): diff --git a/integrationtests/test_data_model.py b/integrationtests/test_data_model.py index bd74a40bde2540bb57245de1de464a1bfd84bc72..bde9eda9f35e57c409c93469d25ce67029f679bd 100644 --- a/integrationtests/test_data_model.py +++ b/integrationtests/test_data_model.py @@ -1,7 +1,7 @@ import unittest import pytest -import caosdb as db +import linkahead as db from caosadvancedtools.models.data_model import DataModel diff --git a/integrationtests/test_datamodel_problems.py b/integrationtests/test_datamodel_problems.py index 855170338fbc81493e407fbe235415d60958c0f0..1ac32bb880155f723a3cbdd429aa6ad0fdbc9605 100644 --- a/integrationtests/test_datamodel_problems.py +++ b/integrationtests/test_datamodel_problems.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -27,10 +27,10 @@ during crawling that tests the integrations of the DataModelProblems class in crawler.py and cfood.py can be found in full-tests. """ -import caosdb as db +import linkahead as db import pytest from caosadvancedtools.datamodel_problems import DataModelProblems -from caosdb.exceptions import (TransactionError, +from linkahead.exceptions import (TransactionError, UnqualifiedParentsError, UnqualifiedPropertiesError) diff --git a/integrationtests/test_im_und_export.py b/integrationtests/test_im_und_export.py index 407faa1a1d3eb609ffd01b9c78d74f1c6a9b231b..5d0aa26bb6bc94de4a3857ffa72d888bc1faafc8 100644 --- a/integrationtests/test_im_und_export.py +++ b/integrationtests/test_im_und_export.py @@ -2,7 +2,7 @@ import os from tempfile import TemporaryDirectory -import caosdb as db +import linkahead as db from caosadvancedtools.export_related import export_related_to from caosadvancedtools.import_from_xml import import_xml @@ -19,7 +19,7 @@ if __name__ == "__main__": assert 0 == len(db.execute_query("FIND File which is stored at " "**/poster.pdf")) print("Importing stored elements") - import_xml(os.path.join(directory.name, "caosdb_data.xml"), interactive=False) + import_xml(os.path.join(directory.name, "linkahead_data.xml"), interactive=False) # The following tests the existence of some required entities. # However, this is not a full list. diff --git a/integrationtests/test_json_schema_datamodel_parser.py b/integrationtests/test_json_schema_datamodel_parser.py index 21ae8d2d7bad5527a7a314220b38af8ff816475f..074c4a067e4a1e3829c5760f97a8b89338a38677 100644 --- a/integrationtests/test_json_schema_datamodel_parser.py +++ b/integrationtests/test_json_schema_datamodel_parser.py @@ -1,5 +1,5 @@ # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -20,7 +20,7 @@ import os -import caosdb as db +import linkahead as db from caosadvancedtools.models.parser import parse_model_from_json_schema diff --git a/integrationtests/test_json_schema_exporter.py b/integrationtests/test_json_schema_exporter.py index 44b428263ebbd9696fc2a171ea356d764482d5e3..5b0d758ed66ca9f641948d70c75f8c255442d5c9 100644 --- a/integrationtests/test_json_schema_exporter.py +++ b/integrationtests/test_json_schema_exporter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2023 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2023 Florian Spreckelsen <f.spreckelsen@indiscale.com> diff --git a/integrationtests/test_table.py b/integrationtests/test_table.py index b8dfe349f3dac3be9bb741f937f2be4f73b6b2af..4e87a7dbcb8d2b14e05cd004c1d773718afe0835 100644 --- a/integrationtests/test_table.py +++ b/integrationtests/test_table.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Henrik tom Wörden # @@ -20,7 +20,7 @@ import logging -import caosdb as db +import linkahead as db import pandas as pd from caosadvancedtools.crawler import TableCrawler diff --git a/integrationtests/test_yaml_parser.py b/integrationtests/test_yaml_parser.py index e2a2c4c056ced56d2605d93914186c2cba97e137..9718c4a2a32d6f31257e58d010e54c7ae8d34f77 100644 --- a/integrationtests/test_yaml_parser.py +++ b/integrationtests/test_yaml_parser.py @@ -1,6 +1,6 @@ # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -19,7 +19,7 @@ # with this program. If not, see <https://www.gnu.org/licenses/>. # -import caosdb as db +import linkahead as db from caosadvancedtools.models.parser import parse_model_from_string diff --git a/integrationtests/update_analysis.py b/integrationtests/update_analysis.py index ddebc049f449026400278a26226d341d64e678c8..18ae8332964877816be95acb4384c8b56a46bb8d 100644 --- a/integrationtests/update_analysis.py +++ b/integrationtests/update_analysis.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -34,7 +34,7 @@ entities that where changed within a certain period of time. import sys -import caosdb as db +import linkahead as db from caosadvancedtools.serverside.generic_analysis import run diff --git a/manual_tests/test_labfolder_import.py b/manual_tests/test_labfolder_import.py index c767feb55cdf3958343d8d9780d01fa10c70f6ec..abc5eb1134dc31335dd6cadcf2cddfd2c2008605 100644 --- a/manual_tests/test_labfolder_import.py +++ b/manual_tests/test_labfolder_import.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (c) 2020 IndiScale GmbH # Copyright (c) 2020 Daniel Hornung <d.hornung@indiscale.com> diff --git a/manual_tests/test_labfolder_retrieve.py b/manual_tests/test_labfolder_retrieve.py index 5bbaf91d0221a402e3a39246a129413adfa5f871..a7f56e804fbe311074c8e860e3740ac8b5cf73f1 100644 --- a/manual_tests/test_labfolder_retrieve.py +++ b/manual_tests/test_labfolder_retrieve.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (c) 2020 IndiScale GmbH # diff --git a/setup.py b/setup.py index bee11751cec9311f65a9ebf3c511ab16ab023c1a..a7146ead2a424dd757c4b1cd0cb37661639ff816 100755 --- a/setup.py +++ b/setup.py @@ -149,7 +149,7 @@ def setup_package(): metadata = dict( name='caosadvancedtools', version=get_version_info()[0], - description='advanced utilities for caosdb', + description='Advanced utilities for LinkAhead', long_description=long_description, long_description_content_type="text/markdown", author='Henrik tom Wörden', diff --git a/src/caosadvancedtools/cache.py b/src/caosadvancedtools/cache.py index bf1287ba35d9c0af28d440db56e38173d38fcacf..749239fa30c5f5e1a384c68ea71be23a14780cd5 100644 --- a/src/caosadvancedtools/cache.py +++ b/src/caosadvancedtools/cache.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -33,7 +33,7 @@ from abc import ABC, abstractmethod from copy import deepcopy from hashlib import sha256 -import caosdb as db +import linkahead as db from lxml import etree diff --git a/src/caosadvancedtools/cfood.py b/src/caosadvancedtools/cfood.py index 588476bd624f7e24a5e0f49380fb1e66f5bd1b17..e79f0373bf4fe8500d0acb4f3c17dff04404d607 100644 --- a/src/caosadvancedtools/cfood.py +++ b/src/caosadvancedtools/cfood.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -23,9 +23,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -""" Defines how something that shall be inserted into CaosDB is treated. +""" Defines how something that shall be inserted into LinkAhead is treated. -CaosDB can automatically be filled with Records based on some structure, a file +LinkAhead can automatically be filled with Records based on some structure, a file structure, a table or similar. The Crawler will iterate over the respective items and test for each item @@ -33,9 +33,9 @@ whether a CFood class exists that matches the file path, i.e. whether CFood class wants to treat that pariticular item. If one does, it is instanciated to treat the match. This occurs in basically three steps: -1. Create a list of identifiables, i.e. unique representation of CaosDB Records +1. Create a list of identifiables, i.e. unique representation of LinkAhead Records (such as an experiment belonging to a project and a date/time). -2. The identifiables are either found in CaosDB or they are created. +2. The identifiables are either found in LinkAhead or they are created. 3. The identifiables are update based on the date in the file structure. """ @@ -45,10 +45,10 @@ import warnings from abc import ABCMeta, abstractmethod from datetime import datetime -import caosdb as db -from caosdb.common.models import Entity -from caosdb.exceptions import (BadQueryError, EmptyUniqueQueryError, - QueryNotUniqueError, TransactionError) +import linkahead as db +from linkahead.common.models import Entity +from linkahead.exceptions import (BadQueryError, EmptyUniqueQueryError, + QueryNotUniqueError, TransactionError) from .datamodel_problems import DataModelProblems from .guard import global_guard as guard @@ -65,7 +65,7 @@ logger = logging.getLogger(__name__) def get_entity(name): """ Returns the entity with a given name, preferably from a local cache. - If the local cache does not contain the entity, retrieve it from CaosDB. + If the local cache does not contain the entity, retrieve it from LinkAhead. """ if name not in ENTITIES: @@ -81,7 +81,7 @@ def get_property(name): cache. If the local cache does not contain the record type, try to - retrieve it from CaosDB. If it does not exist, see whether it + retrieve it from LinkAhead. If it does not exist, see whether it could be a record type used as a property. """ @@ -103,7 +103,7 @@ def get_record(name): """Returns the record with a given name, preferably from a local cache. If the local cache does not contain the record, try to retrieve it - from CaosDB. + from LinkAhead. """ @@ -120,7 +120,7 @@ def get_recordtype(name): cache. If the local cache does not contain the record type, try to - retrieve it from CaosDB. If it does not exist, add it to the data + retrieve it from LinkAhead. If it does not exist, add it to the data model problems """ @@ -140,7 +140,7 @@ def get_recordtype(name): class FileGuide(object): def access(self, path): """ should be replaced by a function that adds - a prefix to paths to allow to access caosdb files locally + a prefix to paths to allow to access LinkAhead files locally This default just returns the unchanged path. """ diff --git a/src/caosadvancedtools/cfoods/__init__.py b/src/caosadvancedtools/cfoods/__init__.py index 30ce05add09a223c2f65dbe187a6cfb1768d7a22..6936568adb417bafa36f28bfd47be3aebd23c214 100644 --- a/src/caosadvancedtools/cfoods/__init__.py +++ b/src/caosadvancedtools/cfoods/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH <www.indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> diff --git a/src/caosadvancedtools/cfoods/h5.py b/src/caosadvancedtools/cfoods/h5.py index dfd6f2905c955c1b4e493da1f2cbf45583ee68dc..3b3b56881df6280cc850441b71fc95ce931dfb03 100644 --- a/src/caosadvancedtools/cfoods/h5.py +++ b/src/caosadvancedtools/cfoods/h5.py @@ -34,7 +34,7 @@ Properties. from copy import deepcopy -import caosdb as db +import linkahead as db import h5py import numpy as np from caosadvancedtools.cfood import fileguide @@ -45,7 +45,7 @@ from ..structure_mapping import (EntityMapping, collect_existing_structure, def h5_attr_to_property(val): - """ returns the value and datatype of a CaosDB Property for the given value + """ returns the value and datatype of a LinkAhead Property for the given value 1d arrays are converted to lists @@ -168,7 +168,7 @@ class H5CFood(AbstractFileCFood): self.to_be_inserted = db.Container() self.insert_missing_structure(self.structure) - # TODO this is a workaround due to the fact that the caosdb library + # TODO this is a workaround due to the fact that the linkahead library # changes the objects in the Container if it is inserted. The graph # structure is flattened. I.e. references to other entity objects are # replaced with their IDs. However this code depends on this graph. diff --git a/src/caosadvancedtools/collect_datamodel.py b/src/caosadvancedtools/collect_datamodel.py index 806d15333cac7f745ce2fb82a02e0214ad2b6616..1c37bab0007f0fa715a0e106c38dd18faf7015b8 100644 --- a/src/caosadvancedtools/collect_datamodel.py +++ b/src/caosadvancedtools/collect_datamodel.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -25,8 +25,8 @@ import argparse import os -import caosdb as db -from caosdb.apiutils import retrieve_entities_with_ids +import linkahead as db +from linkahead.apiutils import retrieve_entities_with_ids from export_related import export diff --git a/src/caosadvancedtools/converter/labfolder_api.py b/src/caosadvancedtools/converter/labfolder_api.py index cf57c0155a3b3970834abb2fc1058215ef7ecba8..fe77282af1456b10e0fe6e4e5c76ae64f423637c 100644 --- a/src/caosadvancedtools/converter/labfolder_api.py +++ b/src/caosadvancedtools/converter/labfolder_api.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (c) 2020 IndiScale GmbH # Copyright (c) 2020 Daniel Hornung <d.hornung@indiscale.com> @@ -27,7 +27,7 @@ import time import html2text -import caosdb as db +import linkahead as db from labfolder.connection import configure_connection # pylint: disable=import-error diff --git a/src/caosadvancedtools/converter/labfolder_export.py b/src/caosadvancedtools/converter/labfolder_export.py index 6e282218b6d451749ad3070693d38299663f1bee..ae38cb107bf007b84005d81cea3ed784998da3cc 100644 --- a/src/caosadvancedtools/converter/labfolder_export.py +++ b/src/caosadvancedtools/converter/labfolder_export.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (c) 2020 IndiScale GmbH # Copyright (c) 2020 Daniel Hornung <d.hornung@indiscale.com> @@ -25,7 +25,7 @@ import os from bs4 import BeautifulSoup -import caosdb as db +import linkahead as db RERUN = False # crawler = Crawler() diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py index fc3b260b4ae26c608b40f26e4b80192fdbd0e00d..7a840624f7287b8292e27c743636df6bbead6d42 100644 --- a/src/caosadvancedtools/crawler.py +++ b/src/caosadvancedtools/crawler.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -25,16 +25,16 @@ # # ** end header # -""" Crawls a file structure and inserts Records into CaosDB based on what is +""" Crawls a file structure and inserts Records into LinkAhead based on what is found. -CaosDB can automatically be filled with Records based on some file structure. +LinkAhead can automatically be filled with Records based on some file structure. The Crawler will iterate over the files and test for each file whether a CFood exists that matches the file path. If one does, it is instanciated to treat the match. This occurs in basically three steps: -1. create a list of identifiables, i.e. unique representation of CaosDB Records +1. create a list of identifiables, i.e. unique representation of LinkAhead Records (such as an experiment belonging to a project and a date/time) -2. the identifiables are either found in CaosDB or they are created. +2. the identifiables are either found in LinkAhead or they are created. 3. the identifiables are update based on the date in the file structure """ @@ -47,8 +47,8 @@ import uuid from datetime import datetime from sqlite3 import IntegrityError -import caosdb as db -from caosdb.exceptions import BadQueryError +import linkahead as db +from linkahead.exceptions import BadQueryError from .cache import IdentifiableCache, UpdateCache, get_pretty_xml from .cfood import RowCFood, add_files, get_ids_for_entities_with_names @@ -69,7 +69,7 @@ def separated(text): def apply_list_of_updates(to_be_updated, update_flags={}, update_cache=None, run_id=None): - """Updates the `to_be_updated` Container, i.e., pushes the changes to CaosDB + """Updates the `to_be_updated` Container, i.e., pushes the changes to LinkAhead after removing possible duplicates. If a chace is provided, uauthorized updates can be cached for further authorization. @@ -78,7 +78,7 @@ def apply_list_of_updates(to_be_updated, update_flags={}, to_be_updated : db.Container Container with the entities that will be updated. update_flags : dict, optional - Dictionary of CaosDB server flags that will be used for the + Dictionary of LinkAhead server flags that will be used for the update. Default is an empty dict. update_cache : UpdateCache or None, optional Cache in which the intended updates will be stored so they can be @@ -147,7 +147,7 @@ class Crawler(object): The Crawler will use those CFoods when crawling. use_cache : bool, optional Whether to use caching (not re-inserting probably existing - objects into CaosDB), defaults to False. + objects into LinkAhead), defaults to False. abort_on_exception : if true, exceptions are raise. Otherwise the crawler continues if an exception occurs. interactive : boolean, optional @@ -271,7 +271,7 @@ class Crawler(object): """ This is the first phase of the crawl. It collects all cfoods that shall be processed. The second phase is iterating over cfoods and updating - CaosDB. This separate first step is necessary in order to allow a + LinkAhead. This separate first step is necessary in order to allow a single cfood being influenced by multiple crawled items. E.g. the FileCrawler can have a single cfood treat multiple files. @@ -512,16 +512,16 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3])) Parameters: ----------- - changes: The CaosDB entities in the version after the update. + changes: The LinkAhead entities in the version after the update. path: the path defining the subtree that is crawled """ from xml.sax.saxutils import escape - caosdb_config = db.configuration.get_config() - if ("advancedtools" in caosdb_config and "crawler.customcssfile" in - caosdb_config["advancedtools"]): - cssfile = caosdb_config["advancedtools"]["crawler.customcssfile"] + linkahead_config = db.configuration.get_config() + if ("advancedtools" in linkahead_config and "crawler.customcssfile" in + linkahead_config["advancedtools"]): + cssfile = linkahead_config["advancedtools"]["crawler.customcssfile"] else: cssfile = None # TODO move path related stuff to sss_helper @@ -584,11 +584,11 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3])) </script> </body> </html> -""".format(url=caosdb_config["Connection"]["url"], +""".format(url=linkahead_config["Connection"]["url"], rid=run_id, changes=escape("\n".join(changes)), customcssfile='<link rel="stylesheet" href="{url}/webinterface/css/{customcssfile}"/>'.format( - url=caosdb_config["Connection"]["url"], customcssfile=cssfile) if cssfile else "", + url=linkahead_config["Connection"]["url"], customcssfile=cssfile) if cssfile else "", path=path) if "SHARED_DIR" in os.environ: @@ -611,11 +611,11 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3])) Parameters: ----------- - changes: The CaosDB entities in the version after the update. + changes: The LinkAhead entities in the version after the update. filename: path to the html site that allow the authorization """ - caosdb_config = db.configuration.get_config() + linkahead_config = db.configuration.get_config() text = """Dear Curator, there where changes that need your authorization. Please check the following carefully and if the changes are ok, click on the following link: @@ -623,12 +623,12 @@ carefully and if the changes are ok, click on the following link: {url}/Shared/{filename} {changes} - """.format(url=caosdb_config["Connection"]["url"], + """.format(url=linkahead_config["Connection"]["url"], filename=filename, changes="\n".join(changes)) try: - fro = caosdb_config["advancedtools"]["crawler.from_mail"] - to = caosdb_config["advancedtools"]["crawler.to_mail"] + fro = linkahead_config["advancedtools"]["crawler.from_mail"] + to = linkahead_config["advancedtools"]["crawler.to_mail"] except KeyError: logger.error("Server Configuration is missing a setting for " "sending mails. The administrator should check " @@ -646,11 +646,11 @@ carefully and if the changes are ok, click on the following link: @staticmethod def find_or_insert_identifiables(identifiables): """ Sets the ids of identifiables (that do not have already an id from the - cache) based on searching CaosDB and retrieves those entities. + cache) based on searching LinkAhead and retrieves those entities. The remaining entities (those which can not be retrieved) have no - correspondence in CaosDB and are thus inserted. + correspondence in LinkAhead and are thus inserted. """ - # looking for matching entities in CaosDB when there is no valid id + # looking for matching entities in LinkAhead when there is no valid id # i.e. there was none set from a cache existing = [] @@ -699,7 +699,7 @@ carefully and if the changes are ok, click on the following link: else: logger.debug("Did not insert any new entities") - logger.debug("Retrieving entities from CaosDB...") + logger.debug("Retrieving entities from LinkAhead...") identifiables.retrieve(unique=True, raise_exception_on_error=False) @staticmethod @@ -735,7 +735,7 @@ carefully and if the changes are ok, click on the following link: @staticmethod def find_existing(entity): - """searches for an entity that matches the identifiable in CaosDB + """searches for an entity that matches the identifiable in LinkAhead Characteristics of the identifiable like, properties, name or id are used for the match. diff --git a/src/caosadvancedtools/datainconsistency.py b/src/caosadvancedtools/datainconsistency.py index 3af8b5a2c0b73746185306a94b987a0800acb899..9931dd685374716107b179f08653f6424153fc78 100644 --- a/src/caosadvancedtools/datainconsistency.py +++ b/src/caosadvancedtools/datainconsistency.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Henrik tom Wörden <h.tomwoerden@indiscale.com> diff --git a/src/caosadvancedtools/datamodel_problems.py b/src/caosadvancedtools/datamodel_problems.py index df5b7e56dfcc939e2eabf6454cb6e81b22a37727..07fef07b99ebf1fa206cfbdc83863d8b73dda516 100644 --- a/src/caosadvancedtools/datamodel_problems.py +++ b/src/caosadvancedtools/datamodel_problems.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Sprckelsen <f.spreckelsen@indiscale.com> @@ -27,7 +27,7 @@ be inserted by hand or gueesed from possible exceptions when inserting or updating entities with missing parents and/or properties. """ -from caosdb.exceptions import (EntityDoesNotExistError, +from linkahead.exceptions import (EntityDoesNotExistError, TransactionError, UnqualifiedParentsError, UnqualifiedPropertiesError) diff --git a/src/caosadvancedtools/example_cfood.py b/src/caosadvancedtools/example_cfood.py index 2e395d5c3030508087e25a7156d35c8954d223d7..45984998451cd41739b696ca8fac5141f71674de 100644 --- a/src/caosadvancedtools/example_cfood.py +++ b/src/caosadvancedtools/example_cfood.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -20,7 +20,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from .cfood import AbstractFileCFood, assure_has_property diff --git a/src/caosadvancedtools/export_related.py b/src/caosadvancedtools/export_related.py index 7ae3a4dbba65faed551f75a1627eb504a3275f48..1ac6d2cbbd9f25f90ff840216bcea7eb3276b3e7 100755 --- a/src/caosadvancedtools/export_related.py +++ b/src/caosadvancedtools/export_related.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH, Henrik tom Wörden # @@ -24,7 +24,7 @@ """ This file allows to create an xml representation of a complete dataset. Using the given entity all related entities are collected and saved in a way -that the data can be imported in another CaosDB instance. +that the data can be imported in another LinkAhead instance. Files that are smaller than 1MB are saved in a downloads folder and can be imported along with the entities themselves. @@ -32,9 +32,9 @@ imported along with the entities themselves. import argparse import os -import caosdb as db -from caosdb.apiutils import apply_to_ids, retrieve_entities_with_ids -from caosdb.common.datatype import get_id_of_datatype, is_reference +import linkahead as db +from linkahead.apiutils import apply_to_ids, retrieve_entities_with_ids +from linkahead.common.datatype import get_id_of_datatype, is_reference from lxml import etree @@ -128,7 +128,7 @@ def export(cont, directory="."): xml = etree.tounicode(cont.to_xml( local_serialization=True), pretty_print=True) - with open(os.path.join(directory, "caosdb_data.xml"), "w") as fi: + with open(os.path.join(directory, "linkahead_data.xml"), "w") as fi: fi.write(xml) diff --git a/src/caosadvancedtools/guard.py b/src/caosadvancedtools/guard.py index aa37448def63a356ff6e3b89327e34dbe4c510be..efda79eded09e0efc4687d58a413357c41086ced 100644 --- a/src/caosadvancedtools/guard.py +++ b/src/caosadvancedtools/guard.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Henrik tom Wörden # @@ -18,7 +18,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db RETRIEVE = 0 INSERT = 1 diff --git a/src/caosadvancedtools/import_from_xml.py b/src/caosadvancedtools/import_from_xml.py index 9d0e03f649db771147915740cabf201fae910760..7bc9f018b491ec64266d2be038b89102479c121e 100755 --- a/src/caosadvancedtools/import_from_xml.py +++ b/src/caosadvancedtools/import_from_xml.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH, Henrik tom Wörden # @@ -31,8 +31,8 @@ import argparse import os from tempfile import NamedTemporaryFile -import caosdb as db -from caosdb.apiutils import apply_to_ids +import linkahead as db +from linkahead.apiutils import apply_to_ids from caosadvancedtools.models.data_model import DataModel diff --git a/src/caosadvancedtools/json_schema_exporter.py b/src/caosadvancedtools/json_schema_exporter.py index c4c6de164aede0ce2e35b2f47fc30275552066b5..5daa5a4ec0543a4ff00c7512e22598b6fe0d50ae 100644 --- a/src/caosadvancedtools/json_schema_exporter.py +++ b/src/caosadvancedtools/json_schema_exporter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2023 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2023 Florian Spreckelsen <f.spreckelsen@indiscale.com> diff --git a/src/caosadvancedtools/loadFiles.py b/src/caosadvancedtools/loadFiles.py index cedef3673f510d1fd9666cfd0f4b4909a4f6087f..c9258afaff88b53f843d684a4d8b18a4baf55688 100755 --- a/src/caosadvancedtools/loadFiles.py +++ b/src/caosadvancedtools/loadFiles.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -45,7 +45,7 @@ from argparse import ArgumentParser from tempfile import NamedTemporaryFile from typing import Union -import caosdb as db +import linkahead as db logger = logging.getLogger(__name__) timeout_fallback = 20 diff --git a/src/caosadvancedtools/models/data_model.py b/src/caosadvancedtools/models/data_model.py index 3be5600239d97689604a64492896e3083d5acd72..4d4cada20c9902c834aab0c481ccefbc856fc77b 100644 --- a/src/caosadvancedtools/models/data_model.py +++ b/src/caosadvancedtools/models/data_model.py @@ -1,7 +1,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -34,7 +34,7 @@ import linkahead.common.models as models from linkahead.apiutils import compare_entities, describe_diff, merge_entities -CAOSDB_INTERNAL_PROPERTIES = [ +LINKAHEAD_INTERNAL_PROPERTIES = [ "description", "name", "unit", @@ -44,19 +44,19 @@ CAOSDB_INTERNAL_PROPERTIES = [ class DataModel(dict): """Provides tools for managing a data model. - When constructing a data model the CaosDB representation can easily be + When constructing a data model the LinkAhead representation can easily be created using the classes RecordType and Propery, storing them in a - Container and inserting it in CaoSDB. However, this has one drawback: You + Container and inserting it in LinkAhead. However, this has one drawback: You cannot simply change someting and update the container. The container will insist on having valid ids for all contained Entities. This class allows you to define your model as easily but also provides you with a method (`sync_data_model`) that will sync with the data model in an - existing CaosDB instance. + existing LinkAhead instance. This is possible because entities, defined in this model, are identified - with entities in CaosDB using names. I.e. a RecordType "Experiment" in this - model will update an existing RecordType with name "Experiment" in CaosDB. + with entities in LinkAhead using names. I.e. a RecordType "Experiment" in this + model will update an existing RecordType with name "Experiment" in LinkAhead. Thus, be carefull not to change existing Entities that were created for a different purpose (e.g. someone else's experiment). @@ -90,9 +90,9 @@ class DataModel(dict): self.append(entity) def sync_data_model(self, noquestion: bool = False, verbose: bool = True): - """Synchronize this DataModel with a CaosDB instance. + """Synchronize this DataModel with a LinkAhead instance. - Updates existing entities from the CaosDB instance and inserts + Updates existing entities from the LinkAhead instance and inserts non-existing entities into the instance. Note: This allows to easily overwrite changes that were made to an existing data model. Use this function with care and double check its effect. @@ -138,7 +138,7 @@ class DataModel(dict): any_change = False for ent in existing_entities: - if ent.name in CAOSDB_INTERNAL_PROPERTIES: + if ent.name in LINKAHEAD_INTERNAL_PROPERTIES: # Workaround for the usage of internal properties like name # in via the extern keyword: ref = db.Property(name=ent.name).retrieve() @@ -171,7 +171,7 @@ class DataModel(dict): @staticmethod def get_existing_entities(entities): """ Return a list with those entities of the supplied iterable that - exist in the CaosDB instance. + exist in the LinkAhead instance. Args ---- diff --git a/src/caosadvancedtools/models/parser.py b/src/caosadvancedtools/models/parser.py index 175f2f7fbfc5408e70e37740d7ae0506d547c628..e74de5ac5ea32875bd2b80f69b980d1cf6f177f1 100644 --- a/src/caosadvancedtools/models/parser.py +++ b/src/caosadvancedtools/models/parser.py @@ -1,4 +1,4 @@ -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -49,7 +49,7 @@ import jsonschema import linkahead as db from linkahead.common.datatype import get_list_datatype -from .data_model import CAOSDB_INTERNAL_PROPERTIES, DataModel +from .data_model import LINKAHEAD_INTERNAL_PROPERTIES, DataModel # Keywords which are allowed in data model descriptions. KEYWORDS = ["importance", @@ -200,7 +200,7 @@ def parse_model_from_json_schema( out : Datamodel The datamodel generated from the input schema which then can be used for - synchronizing with CaosDB. + synchronizing with LinkAhead. Note ---- @@ -301,7 +301,7 @@ debug : bool, optional # Extern keyword: # The extern keyword can be used to include Properties and RecordTypes - # from existing CaosDB datamodels into the current model. + # from existing LinkAhead datamodels into the current model. # Any name included in the list specified by the extern keyword # will be used in queries to retrieve a property or (if no property exists) # a record type with the name of the element. @@ -312,7 +312,7 @@ debug : bool, optional ymlmodel["extern"] = [] for name in ymlmodel["extern"]: - if name in CAOSDB_INTERNAL_PROPERTIES: + if name in LINKAHEAD_INTERNAL_PROPERTIES: self.model[name] = db.Property(name=name).retrieve() continue for role in ("Property", "RecordType", "Record", "File"): @@ -610,7 +610,7 @@ debug : bool, optional iterate over properties and check whether it is a base datatype of a name that was defined in the model (or extern part) - the string representations are replaced with caosdb objects + the string representations are replaced with linkahead objects """ @@ -816,12 +816,12 @@ class JsonSchemaParser(Parser): raise JsonSchemaDefinitionError( f"`type` is missing in element {name}.") if name == "name": - # This is identified with the CaosDB name property as long as the + # This is identified with the LinkAhead name property as long as the # type is correct. if not elt["type"] == "string" and "string" not in elt["type"]: raise JsonSchemaDefinitionError( "The 'name' property must be string-typed, otherwise it cannot " - "be identified with CaosDB's name property." + "be identified with LinkAhead's name property." ) return None, force_list # LinkAhead suports null for all types, so in the very special case of diff --git a/src/caosadvancedtools/pandoc_header_tools.py b/src/caosadvancedtools/pandoc_header_tools.py index e746a26ac19c00de4ee7785399ef98478472340c..e0e62c8c75c7759338972b274c5c79617347aeeb 100644 --- a/src/caosadvancedtools/pandoc_header_tools.py +++ b/src/caosadvancedtools/pandoc_header_tools.py @@ -6,7 +6,7 @@ # A. Schlemmer, 04/2019 # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/caosadvancedtools/read_md_header.py b/src/caosadvancedtools/read_md_header.py index ece81c403af7ca65fb48ebd457fdded8544413e8..cc3e2152a38536fedbc538661cdcf7f086ae5501 100644 --- a/src/caosadvancedtools/read_md_header.py +++ b/src/caosadvancedtools/read_md_header.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) # A. Schlemmer, 01/2019 @@ -34,7 +34,7 @@ def get_header(fn): # import os # import re -# import caosdb as db +# import linkahead as db # import yaml # from .cfood import AbstractCFood, get_entity diff --git a/src/caosadvancedtools/scifolder/analysis_cfood.py b/src/caosadvancedtools/scifolder/analysis_cfood.py index adce7225649ddf80852588d1cb78d045c04db1d3..0216f53468e87e2a91a2427a2cbbd5c2be392eab 100644 --- a/src/caosadvancedtools/scifolder/analysis_cfood.py +++ b/src/caosadvancedtools/scifolder/analysis_cfood.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_property, assure_object_is_in_list, @@ -51,7 +51,7 @@ class AnalysisCFood(AbstractFileCFood, WithREADME): @staticmethod def name_beautifier(name): """ a function that can be used to rename the project. I.e. if - the project in CaosDB shall be named differently than in the folder + the project in LinkAhead shall be named differently than in the folder structure. Use discouraged. """ diff --git a/src/caosadvancedtools/scifolder/experiment_cfood.py b/src/caosadvancedtools/scifolder/experiment_cfood.py index 83329863433d302e16744a781a3b599fe0bb11f5..b19b29242909a6f447da2903cb6e2040121b4e53 100644 --- a/src/caosadvancedtools/scifolder/experiment_cfood.py +++ b/src/caosadvancedtools/scifolder/experiment_cfood.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_property, assure_object_is_in_list, diff --git a/src/caosadvancedtools/scifolder/publication_cfood.py b/src/caosadvancedtools/scifolder/publication_cfood.py index 68e345aca1bd650b4da784f4741866683bd4f04a..61e0a0ef0d63cf2d7eb43dd9ca90a2138324babf 100644 --- a/src/caosadvancedtools/scifolder/publication_cfood.py +++ b/src/caosadvancedtools/scifolder/publication_cfood.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractFileCFood, assure_object_is_in_list, fileguide, ) diff --git a/src/caosadvancedtools/scifolder/result_table_cfood.py b/src/caosadvancedtools/scifolder/result_table_cfood.py index e32cd0bd1efe77d5be4583c8bae764a677e33fc4..fec2903953d0f5479d89531c0e3f8f7e88073f84 100644 --- a/src/caosadvancedtools/scifolder/result_table_cfood.py +++ b/src/caosadvancedtools/scifolder/result_table_cfood.py @@ -18,7 +18,7 @@ import re -import caosdb as db +import linkahead as db import pandas as pd from caosadvancedtools.cfood import (AbstractFileCFood, ) diff --git a/src/caosadvancedtools/scifolder/simulation_cfood.py b/src/caosadvancedtools/scifolder/simulation_cfood.py index f8f3d07e30b81e42591ce0c4698c0f47164f2b90..5127cbfd071a8232f6721a5d1a108144a50eaa12 100644 --- a/src/caosadvancedtools/scifolder/simulation_cfood.py +++ b/src/caosadvancedtools/scifolder/simulation_cfood.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_property, assure_object_is_in_list, diff --git a/src/caosadvancedtools/scifolder/software_cfood.py b/src/caosadvancedtools/scifolder/software_cfood.py index d91817f10a278b91f7c52aa1a0674b1a2daa0394..589112c567541a9fe19a630b552750e561b0ac5c 100644 --- a/src/caosadvancedtools/scifolder/software_cfood.py +++ b/src/caosadvancedtools/scifolder/software_cfood.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_property, assure_name_is, assure_object_is_in_list, diff --git a/src/caosadvancedtools/scifolder/utils.py b/src/caosadvancedtools/scifolder/utils.py index cbf87c4b802c829f34f4368c3605ce05fa42cfb2..8e832c10fc9227365535314ce4cc2cdf6d49b212 100644 --- a/src/caosadvancedtools/scifolder/utils.py +++ b/src/caosadvancedtools/scifolder/utils.py @@ -21,7 +21,7 @@ import logging import os from itertools import chain -import caosdb as db +import linkahead as db import pandas as pd from caosadvancedtools.cfood import assure_object_is_in_list, fileguide from caosadvancedtools.utils import (find_records_that_reference_ids, diff --git a/src/caosadvancedtools/scifolder/withreadme.py b/src/caosadvancedtools/scifolder/withreadme.py index d8388e1d28bd23e1804c2f747a47f4ea97d265b0..94280b8068d36c0117681b50270f819c7ceb0c8b 100644 --- a/src/caosadvancedtools/scifolder/withreadme.py +++ b/src/caosadvancedtools/scifolder/withreadme.py @@ -22,7 +22,7 @@ import logging import os from dataclasses import dataclass -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (assure_has_description, assure_has_parent, assure_object_is_in_list, fileguide) from caosadvancedtools.read_md_header import get_header as get_md_header diff --git a/src/caosadvancedtools/serverside/examples/example_script.py b/src/caosadvancedtools/serverside/examples/example_script.py index d97d2d0d1f936b1c12e857d38fce043f0b514340..fe9bbaa7b417f99cec58d3747402b5c99b957582 100755 --- a/src/caosadvancedtools/serverside/examples/example_script.py +++ b/src/caosadvancedtools/serverside/examples/example_script.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -45,7 +45,7 @@ import sys from argparse import RawTextHelpFormatter from datetime import datetime -import caosdb as db +import linkahead as db import matplotlib.pyplot as plt import numpy as np from caosadvancedtools.cfood import assure_property_is @@ -68,18 +68,18 @@ def send_mail(changes: [db.Entity], receipient: str): Parameters: ----------- - changes: The CaosDB entities in the version after the update. + changes: The LinkAhead entities in the version after the update. receipient: The person who shall receive the mail. """ - caosdb_config = db.configuration.get_config() + linkahead_config = db.configuration.get_config() text = """Dear Curator, The following changes where done automatically. {changes} """.format(changes="\n".join(changes)) try: - fro = caosdb_config["advancedtools"]["automated_updates.from_mail"] + fro = linkahead_config["advancedtools"]["automated_updates.from_mail"] except KeyError: logger.error("Server Configuration is missing a setting for " "sending mails. The administrator should check " diff --git a/src/caosadvancedtools/serverside/generic_analysis.py b/src/caosadvancedtools/serverside/generic_analysis.py index 7c7b26cc3ddb19ff54710f04debe3c0a48f35b82..e32e02d000be51eb84a25648dbbc4c97756f4a39 100644 --- a/src/caosadvancedtools/serverside/generic_analysis.py +++ b/src/caosadvancedtools/serverside/generic_analysis.py @@ -87,8 +87,8 @@ import logging import os import sys -import caosdb as db -from caosdb.utils.server_side_scripting import run_server_side_script +import linkahead as db +from linkahead.utils.server_side_scripting import run_server_side_script logger = logging.getLogger(__name__) diff --git a/src/caosadvancedtools/serverside/helper.py b/src/caosadvancedtools/serverside/helper.py index b7289c7ffd1d67ebd9862aa5f92cd41ccc62d706..ec8083ab5a045bbe7db747f8bf7799cac3352d04 100644 --- a/src/caosadvancedtools/serverside/helper.py +++ b/src/caosadvancedtools/serverside/helper.py @@ -30,7 +30,7 @@ import sys from email import message, policy, utils from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db def wrap_bootstrap_alert(text, kind): @@ -165,7 +165,7 @@ def recordtype_is_child_of(rt, parent): Parameters ---------- - rt : caosdb.Entity + rt : linkahead.Entity The child RecordType. parent : str or int The parent's name or id. @@ -193,7 +193,7 @@ def init_data_model(entities): Parameters ---------- - entities : iterable of caosdb.Entity + entities : iterable of linkahead.Entity The data model entities which are to be checked for existence. Raises @@ -339,7 +339,7 @@ def send_mail(from_addr, to, subject, body, cc=None, bcc=None, send_mail_bin=None): """ Send an email via the configured send_mail client. - The relevant options in the pycaosdb.ini are: + The relevant options in the pylinkahead.ini are: [Misc] sendmail = ... @@ -365,8 +365,8 @@ def send_mail(from_addr, to, subject, body, cc=None, bcc=None, ------ subprocess.CalledProcessError If the sendmail client returned with a non-zero code. - caosdb.ConfigurationException - If the caosdb configuration has no `Misc.sendmail` configured while the + linkahead.ConfigurationException + If the linkahead configuration has no `Misc.sendmail` configured while the `send_mail_bin` parameter is None. """ @@ -389,14 +389,14 @@ def send_mail(from_addr, to, subject, body, cc=None, bcc=None, if send_mail_bin is not None: sendmail = send_mail_bin else: - caosdb_config = db.configuration.get_config() + linkahead_config = db.configuration.get_config() - if "Misc" not in caosdb_config or "sendmail" not in caosdb_config["Misc"]: + if "Misc" not in linkahead_config or "sendmail" not in linkahead_config["Misc"]: err_msg = ("No sendmail executable configured. " "Please configure `Misc.sendmail` " - "in your pycaosdb.ini.") + "in your pylinkahead.ini.") raise db.ConfigurationError(err_msg) - sendmail = caosdb_config["Misc"]["sendmail"] + sendmail = linkahead_config["Misc"]["sendmail"] # construct sendmail command # options explained (from `man sendmail`): @@ -438,7 +438,7 @@ def get_file_via_download(ent, logger=logging.getLogger(__name__)): try: # TODO remove the following treatment of size=0 when the # following issue is resolved: - # https://gitlab.com/caosdb/caosdb-server/-/issues/107 + # https://gitlab.com/linkahead/linkahead-server/-/issues/107 if ent.size > 0: val_file = ent.download() @@ -450,7 +450,7 @@ def get_file_via_download(ent, logger=logging.getLogger(__name__)): logger.error("The checksum of the downloaded file with id={} did not " "match.".format(ent.id)) raise e - except db.CaosDBException as e: + except db.LinkAheadException as e: logger.error("Cannot download the file with id={}.".format(ent.id)) raise e diff --git a/src/caosadvancedtools/structure_mapping.py b/src/caosadvancedtools/structure_mapping.py index 50e57ac4d84f2034fbdb6da6c7159f450a993c3a..bf446c2a240ca16610527b38c67f3c29a75eca4b 100644 --- a/src/caosadvancedtools/structure_mapping.py +++ b/src/caosadvancedtools/structure_mapping.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 IndiScale GmbH <www.indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -18,9 +18,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db -from caosdb.apiutils import resolve_reference -from caosdb.common.utils import uuid +import linkahead as db +from linkahead.apiutils import resolve_reference +from linkahead.common.utils import uuid from .cfood import (assure_has_description, assure_has_parent, assure_property_is) diff --git a/src/caosadvancedtools/table_converter.py b/src/caosadvancedtools/table_converter.py index 7d1097e13a0780a7656a18c71bf7f408df5c69c5..2f0d4cc9285e43627e75e3971ee41d224254e902 100644 --- a/src/caosadvancedtools/table_converter.py +++ b/src/caosadvancedtools/table_converter.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Henrik tom Wörden # @@ -24,7 +24,7 @@ import argparse import re import sys -import caosdb as db +import linkahead as db import numpy as np import pandas as pd diff --git a/src/caosadvancedtools/table_export.py b/src/caosadvancedtools/table_export.py index eabb10754bdb93859dcc6ef3d3ff0838fa6ff6d4..00e644e436bde7e84043175bdeb050f07b969a3d 100644 --- a/src/caosadvancedtools/table_export.py +++ b/src/caosadvancedtools/table_export.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Sprecklelsen <f.spreckelsen@indiscale.com> @@ -22,7 +22,7 @@ # # ** end header # -"""Collect optional and mandatory data from CaosDB records and prepare +"""Collect optional and mandatory data from LinkAhead records and prepare them for an export as a table, e.g., for the export to metadata repositories. @@ -31,7 +31,7 @@ from inspect import signature import json import logging -import caosdb as db +import linkahead as db FIND_FUNCTION = "find_func" QUERY = "query" @@ -39,7 +39,7 @@ QUERY = "query" logger = logging.getLogger(__name__) -class TableExportError(db.CaosDBException): +class TableExportError(db.LinkAheadException): """Error that is raised in case of failing export, e.g., because of missing mandatory entries. diff --git a/src/caosadvancedtools/utils.py b/src/caosadvancedtools/utils.py index 05000a34fd27162837ecfe316b20af42b1156c45..9a0342e991ddd9d7ea5fe907057a1d3d97ecf5ef 100644 --- a/src/caosadvancedtools/utils.py +++ b/src/caosadvancedtools/utils.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -27,8 +27,8 @@ import logging import os import pathlib -import caosdb as db -from caosdb.exceptions import TransactionError +import linkahead as db +from linkahead.exceptions import TransactionError logger = logging.getLogger(__name__) diff --git a/src/doc/Makefile b/src/doc/Makefile index 7a1bec105f4b0fe1d70cabd7e3cf5f1ceff93bee..2df1aff867758c005fcd2357f0238cb60d3c2174 100644 --- a/src/doc/Makefile +++ b/src/doc/Makefile @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> diff --git a/src/doc/crawler.rst b/src/doc/crawler.rst index d7b351bb3132cefed8920f977b345dc32e4db819..3323631e174f07169dae9c4e323299af3160a541 100644 --- a/src/doc/crawler.rst +++ b/src/doc/crawler.rst @@ -241,7 +241,7 @@ Let’s look at the following Example: >>> # Example CFood >>> from caosadvancedtools.cfood import AbstractFileCFood, assure_has_property - >>> import caosdb as db + >>> import linkahead as db >>> >>> class ExampleCFood(AbstractFileCFood): ... @staticmethod diff --git a/unittests/create_filetree.py b/unittests/create_filetree.py index f80b9681163859027bb8f8c7cd6b1387bf2d378d..bbd7783cd15331956b1aeaf80074e1a631dedd24 100644 --- a/unittests/create_filetree.py +++ b/unittests/create_filetree.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/unittests/caosdbignore-example b/unittests/linkaheadignore-example similarity index 100% rename from unittests/caosdbignore-example rename to unittests/linkaheadignore-example diff --git a/unittests/test_base_table_exporter.py b/unittests/test_base_table_exporter.py index 8a65b71aa489f8fca457c0e700452a6dc5956eed..c69a64a0d44639563656688f7ef993963aaa725c 100644 --- a/unittests/test_base_table_exporter.py +++ b/unittests/test_base_table_exporter.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Sprecklelsen <f.spreckelsen@indiscale.com> @@ -28,7 +28,7 @@ tested without db connection. """ import json import os -import caosdb as db +import linkahead as db from pytest import raises from caosadvancedtools import table_export as te diff --git a/unittests/test_cache.py b/unittests/test_cache.py index de3430bf2f28a6b05ea36b1047ac11937809ff44..1a53f16d7e865e2299e427ed1c6692f4b0c35a60 100644 --- a/unittests/test_cache.py +++ b/unittests/test_cache.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Henrik tom Wörden # @@ -26,7 +26,7 @@ from copy import deepcopy from tempfile import NamedTemporaryFile import sqlite3 -import caosdb as db +import linkahead as db from caosadvancedtools.cache import IdentifiableCache, cleanXML from lxml import etree diff --git a/unittests/test_caosdbignore.py b/unittests/test_caosdbignore.py index 9394bf0c8b177bc6df132ee0b43dcb2753d70f28..c044a8e8c53d7caa9bd0eb934e22801ea0d3bde2 100644 --- a/unittests/test_caosdbignore.py +++ b/unittests/test_caosdbignore.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2022 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -34,12 +34,12 @@ from caosadvancedtools.loadFiles import compile_file_list, create_re_for_file_li BASEDIR = os.path.dirname(os.path.realpath(__file__)) -class Caosdbignore(unittest.TestCase): +class Linkaheadignore(unittest.TestCase): def setUp(self): pass def test_compile(self): - files = compile_file_list(os.path.join(BASEDIR, "caosdbignore-example"), + files = compile_file_list(os.path.join(BASEDIR, "linkaheadignore-example"), os.path.join(BASEDIR, "data")) assert len(files) == 3 assert os.path.join(BASEDIR, "data", "datatypes.xlsx") in files diff --git a/unittests/test_cfood.py b/unittests/test_cfood.py index e2f15ffdc7929fbd67aee37bccdb0f44cacef104..77fd654ba7a69f47eb272dbeaae0c1c6827f22d9 100644 --- a/unittests/test_cfood.py +++ b/unittests/test_cfood.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -24,7 +24,7 @@ import re import unittest -import caosdb as db +import linkahead as db from caosadvancedtools.cfood import (AbstractCFood, AbstractFileCFood, CMeal, assure_has_parent, assure_has_property, assure_object_is_in_list, diff --git a/unittests/test_crawler.py b/unittests/test_crawler.py index 64bf291c1181d901ac39a4d2535dcd6eddf39f70..15e783a6d78667584576900841789cdf5cd1440e 100644 --- a/unittests/test_crawler.py +++ b/unittests/test_crawler.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -23,7 +23,7 @@ import re import unittest -import caosdb as db +import linkahead as db from caosadvancedtools.crawler import Crawler diff --git a/unittests/test_data_model.py b/unittests/test_data_model.py index cafeb6ca6a43d7e0409aee3352b43f26d5208732..354e0bf6f399337ec066f95d5fbe5e7593b56fbb 100644 --- a/unittests/test_data_model.py +++ b/unittests/test_data_model.py @@ -1,6 +1,6 @@ import unittest -import caosdb as db +import linkahead as db from caosadvancedtools.models.data_model import DataModel from caosadvancedtools.models.parser import parse_model_from_string diff --git a/unittests/test_generic_analysis.py b/unittests/test_generic_analysis.py index a1077b97ec58f80c8534c89d5fa5f57d8d815cb9..3e6f4dbc1a4fc86e0ed36eba096cd2a75ac2208e 100644 --- a/unittests/test_generic_analysis.py +++ b/unittests/test_generic_analysis.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -27,7 +27,7 @@ module description """ -import caosdb as db +import linkahead as db from caosadvancedtools.serverside.generic_analysis import \ check_referenced_script diff --git a/unittests/test_json_schema_exporter.py b/unittests/test_json_schema_exporter.py index 1cea2f58e42d28545b8354d0f821ab2c61e7a4f8..fd6dbf7cd115068c2c172b33a25a24f33a6d373c 100644 --- a/unittests/test_json_schema_exporter.py +++ b/unittests/test_json_schema_exporter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2023 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2023 Florian Spreckelsen <f.spreckelsen@indiscale.com> diff --git a/unittests/test_json_schema_model_parser.py b/unittests/test_json_schema_model_parser.py index a991076e6a1e1a3e92cafc7f1bb88b42b4b2ab3d..cdd4c07427a5e333ac359f9f2452741e4ed72f68 100644 --- a/unittests/test_json_schema_model_parser.py +++ b/unittests/test_json_schema_model_parser.py @@ -1,5 +1,5 @@ # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -24,7 +24,7 @@ import os import pytest -import caosdb as db +import linkahead as db from caosadvancedtools.models.parser import (parse_model_from_json_schema, JsonSchemaDefinitionError) @@ -357,7 +357,7 @@ def test_name_property(): broken = parse_model_from_json_schema(os.path.join( FILEPATH, "datamodel_name_wrong_type.schema.json")) assert str(err.value).startswith( - "The 'name' property must be string-typed, otherwise it cannot be identified with CaosDB's " + "The 'name' property must be string-typed, otherwise it cannot be identified with LinkAhead's " "name property.") diff --git a/unittests/test_read_md_header.py b/unittests/test_read_md_header.py index 994f8f16b6158914ff87134f3efd6f157dea6736..71873e05ceffbc1fa74d2a68764013d94e8de1ce 100644 --- a/unittests/test_read_md_header.py +++ b/unittests/test_read_md_header.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Henrik tom Wörden # @@ -25,7 +25,7 @@ import unittest from copy import deepcopy from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db from caosadvancedtools.read_md_header import get_header diff --git a/unittests/test_result_table_cfood.py b/unittests/test_result_table_cfood.py index 3341a2394cc9ef15ae172bb8992445d87c60d063..ad0d639707017dd03a28ea9c956b4c8396631fdd 100644 --- a/unittests/test_result_table_cfood.py +++ b/unittests/test_result_table_cfood.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -32,7 +32,7 @@ import os import re import unittest -import caosdb as db +import linkahead as db from caosadvancedtools.scifolder.result_table_cfood import ResultTableCFood diff --git a/unittests/test_sss_helper.py b/unittests/test_sss_helper.py index 71408fa6e34f17f18a803e00e944ef9105eae311..c040f5035342c5dfa3e14d79e857a19a49a60387 100644 --- a/unittests/test_sss_helper.py +++ b/unittests/test_sss_helper.py @@ -3,13 +3,13 @@ from email import message_from_file, policy from os import listdir, remove from os.path import abspath, dirname, exists, isfile, join -import caosdb as db +import linkahead as db from caosadvancedtools.serverside.helper import (NameCollector, get_data, get_file_via_download, init_data_model, parse_arguments, send_mail) -from caosdb import RecordType, configure_connection, get_config -from caosdb.connection.mockup import MockUpResponse, MockUpServerConnection +from linkahead import RecordType, configure_connection, get_config +from linkahead.connection.mockup import MockUpResponse, MockUpServerConnection from pytest import mark, raises @@ -110,8 +110,8 @@ def test_get_file_via_download(): # TODO test whether something ends up in the logger class NotThere(DummyFile): def download(*args, **kwargs): - raise db.CaosDBException() - with raises(db.CaosDBException): + raise db.LinkAheadException() + with raises(db.LinkAheadException): get_file_via_download(Inconsistent()) diff --git a/unittests/test_structure_mapping.py b/unittests/test_structure_mapping.py index 5cc4114fc7f92c580f53dd8855bda659082e2b46..a426cf78f35017a02414a091850501332737fec0 100644 --- a/unittests/test_structure_mapping.py +++ b/unittests/test_structure_mapping.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2021 IndiScale GmbH <www.indiscale.com> # Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -22,10 +22,10 @@ import unittest from os import name -import caosdb as db +import linkahead as db from caosadvancedtools.structure_mapping import (EntityMapping, collect_existing_structure) -from caosdb.common import datatype +from linkahead.common import datatype class structureMappingTest(unittest.TestCase): diff --git a/unittests/test_suppressKnown.py b/unittests/test_suppressKnown.py index 07c2e18ead500f26556e2400611a0357f26f169f..6f87e8429638c9035fcb805b3b29ebb72d86caff 100644 --- a/unittests/test_suppressKnown.py +++ b/unittests/test_suppressKnown.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 IndiScale GmbH # Copyright (C) 2020 Henrik tom Wörden diff --git a/unittests/test_table_converter.py b/unittests/test_table_converter.py index 9b1ac11b7c9ed5251f05c921fb08f7c42079c91a..b4f0c4d32d0c28044f7865b3b0dbd2f74210d74b 100644 --- a/unittests/test_table_converter.py +++ b/unittests/test_table_converter.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Henrik tom Wörden # @@ -24,9 +24,9 @@ import os import unittest from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db import pandas as pd -from caosdb.apiutils import compare_entities +from linkahead.apiutils import compare_entities from numpy import nan from caosadvancedtools.table_converter import (from_table, from_tsv, to_table, diff --git a/unittests/test_update_cache.py b/unittests/test_update_cache.py index 8376da482b4828dd09de2ac6f3aca4fb9617c08d..318a35ae50dd280cdd4adf9a802b8e80029a3d7f 100644 --- a/unittests/test_update_cache.py +++ b/unittests/test_update_cache.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2020 Henrik tom Wörden # @@ -26,7 +26,7 @@ import unittest from copy import deepcopy from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db from caosadvancedtools.cache import UpdateCache, get_pretty_xml diff --git a/unittests/test_utils.py b/unittests/test_utils.py index 468e9200de723c65c75e21912b5b3940d758821c..09688f97a6ce73ba1a8f4463f01853a358e5b1dc 100644 --- a/unittests/test_utils.py +++ b/unittests/test_utils.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2019 Henrik tom Wörden # @@ -24,12 +24,12 @@ import logging import unittest from tempfile import NamedTemporaryFile -import caosdb as db +import linkahead as db from caosadvancedtools.utils import (check_win_path, get_referenced_files, string_to_person, create_entity_link) -from caosdb import RecordType, configure_connection, get_config -from caosdb.connection.mockup import MockUpResponse, MockUpServerConnection -from caosdb.exceptions import TransactionError +from linkahead import RecordType, configure_connection, get_config +from linkahead.connection.mockup import MockUpResponse, MockUpServerConnection +from linkahead.exceptions import TransactionError class BaseMockUpTest(unittest.TestCase): diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py index 9ca92a1d696d691d1e4b8eccbd85655ec1488a3b..f8e275078fbd53960673b1241f6bfe7c712c064b 100644 --- a/unittests/test_yaml_model_parser.py +++ b/unittests/test_yaml_model_parser.py @@ -1,4 +1,4 @@ -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead project. # # Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2023 Daniel Hornung <d.hornung@indiscale.com>