diff --git a/README.md b/README.md index 523fcffe69caf83684f2cc9cb9940e881b85c0c1..5a1b4ceb4001b92b4f168eac7d32e6a63ac38798 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,27 @@ # __python-common__ -This repository contains the common components for building a parser for the NOMAD project. The following instructions were tested on Ubuntu 14.04. + + +This repository contains the common python files that are +part of the [NOMAD Laboratory](http://nomad-lab.eu). +The official version lives at + + git@gitlab.mpcdf.mpg.de:nomad-lab/python-common.git + +you can browse it at + + https://gitlab.mpcdf.mpg.de/nomad-lab/python-common + +Some things rely on having the nomad-meta-info checked out at the same level. +The simplest way to have this is to check out nomad-lab-base recursively: + + git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git + +then this will be in python-common within it. # Quick Install + +The following instructions were tested on Ubuntu 14.04. + The modules used for parser development are located under the 'nomadcore' package. You can setup this package in any way you like, but a simple installation script 'setup.py' is provided for ease of use. It will install the nomadcore package along with the needed dependencies. You can install the package in development mode by calling the terminal command ```sh @@ -40,4 +60,4 @@ or the addition can be made permanent by adding the line export PYTHONPATH="${PYTHONPATH}:/path/to/python-common/python" ``` -to your ~/.bashrc file. \ No newline at end of file +to your ~/.bashrc file. diff --git a/python/nomadcore/ActivateLogging.py b/common/python/nomadcore/ActivateLogging.py similarity index 100% rename from python/nomadcore/ActivateLogging.py rename to common/python/nomadcore/ActivateLogging.py diff --git a/python/nomadcore/__init__.py b/common/python/nomadcore/__init__.py similarity index 100% rename from python/nomadcore/__init__.py rename to common/python/nomadcore/__init__.py diff --git a/python/nomadcore/basic_meta_info.py b/common/python/nomadcore/basic_meta_info.py similarity index 100% rename from python/nomadcore/basic_meta_info.py rename to common/python/nomadcore/basic_meta_info.py diff --git a/python/nomadcore/caching_backend.py b/common/python/nomadcore/caching_backend.py similarity index 100% rename from python/nomadcore/caching_backend.py rename to common/python/nomadcore/caching_backend.py diff --git a/python/nomadcore/compact_sha.py b/common/python/nomadcore/compact_sha.py similarity index 100% rename from python/nomadcore/compact_sha.py rename to common/python/nomadcore/compact_sha.py diff --git a/python/nomadcore/coordinate_reader.py b/common/python/nomadcore/coordinate_reader.py similarity index 100% rename from python/nomadcore/coordinate_reader.py rename to common/python/nomadcore/coordinate_reader.py diff --git a/python/nomadcore/json_support.py b/common/python/nomadcore/json_support.py similarity index 100% rename from python/nomadcore/json_support.py rename to common/python/nomadcore/json_support.py diff --git a/python/nomadcore/local_meta_info.py b/common/python/nomadcore/local_meta_info.py similarity index 100% rename from python/nomadcore/local_meta_info.py rename to common/python/nomadcore/local_meta_info.py diff --git a/python/nomadcore/model_archive.py b/common/python/nomadcore/model_archive.py similarity index 100% rename from python/nomadcore/model_archive.py rename to common/python/nomadcore/model_archive.py diff --git a/python/nomadcore/model_base.py b/common/python/nomadcore/model_base.py similarity index 100% rename from python/nomadcore/model_base.py rename to common/python/nomadcore/model_base.py diff --git a/python/nomadcore/model_meta_info.py b/common/python/nomadcore/model_meta_info.py similarity index 100% rename from python/nomadcore/model_meta_info.py rename to common/python/nomadcore/model_meta_info.py diff --git a/python/nomadcore/parse_streamed_dicts.py b/common/python/nomadcore/parse_streamed_dicts.py similarity index 100% rename from python/nomadcore/parse_streamed_dicts.py rename to common/python/nomadcore/parse_streamed_dicts.py diff --git a/python/nomadcore/parser_backend.py b/common/python/nomadcore/parser_backend.py similarity index 100% rename from python/nomadcore/parser_backend.py rename to common/python/nomadcore/parser_backend.py diff --git a/python/nomadcore/simple_parser.py b/common/python/nomadcore/simple_parser.py similarity index 100% rename from python/nomadcore/simple_parser.py rename to common/python/nomadcore/simple_parser.py diff --git a/python/nomadcore/unit_conversion/__init__.py b/common/python/nomadcore/unit_conversion/__init__.py similarity index 100% rename from python/nomadcore/unit_conversion/__init__.py rename to common/python/nomadcore/unit_conversion/__init__.py diff --git a/python/nomadcore/unit_conversion/constants.txt b/common/python/nomadcore/unit_conversion/constants.txt similarity index 100% rename from python/nomadcore/unit_conversion/constants.txt rename to common/python/nomadcore/unit_conversion/constants.txt diff --git a/python/nomadcore/unit_conversion/unit_conversion.py b/common/python/nomadcore/unit_conversion/unit_conversion.py similarity index 100% rename from python/nomadcore/unit_conversion/unit_conversion.py rename to common/python/nomadcore/unit_conversion/unit_conversion.py diff --git a/python/nomadcore/unit_conversion/units.txt b/common/python/nomadcore/unit_conversion/units.txt similarity index 100% rename from python/nomadcore/unit_conversion/units.txt rename to common/python/nomadcore/unit_conversion/units.txt diff --git a/python/nomadcore/utils.py b/common/python/nomadcore/utils.py similarity index 100% rename from python/nomadcore/utils.py rename to common/python/nomadcore/utils.py diff --git a/python/nomadscripts/__init__.py b/common/python/nomadscripts/__init__.py similarity index 100% rename from python/nomadscripts/__init__.py rename to common/python/nomadscripts/__init__.py diff --git a/python/nomadscripts/calculate_meta_info_overrides.py b/common/python/nomadscripts/calculate_meta_info_overrides.py similarity index 98% rename from python/nomadscripts/calculate_meta_info_overrides.py rename to common/python/nomadscripts/calculate_meta_info_overrides.py index 3881f78d7865cf8a901a80cff7bffcaf67691b1f..5d71febd65b258617b1b9aba772a35fb860629b4 100644 --- a/python/nomadscripts/calculate_meta_info_overrides.py +++ b/common/python/nomadscripts/calculate_meta_info_overrides.py @@ -216,8 +216,8 @@ def buildOverrides(oldValues, newValues): if __name__ == "__main__": - overridesDir = os.path.normpath(os.path.join(basePath,"../nomad_meta_info_overrides")) - defaultPath = os.path.normpath(os.path.join(basePath,"../nomad_meta_info")) + overridesDir = os.path.normpath(os.path.join(basePath,"../../../nomad-meta-info/meta_info/nomad_meta_info_overrides")) + defaultPath = os.path.normpath(os.path.join(basePath,"../../../nomad-meta-info/meta_info/nomad_meta_info")) usage = """usage: {command} [--check-only] [--old-ref <ref1=HEAD>] [--old-path <path=None>] [--help] [--new-ref <ref2=None>] [--new-path <path=basePath>] [--repo-path <repoPath=None>] [--overrides-dir <overridesDir>] [--no-clobber] [--verbose] [<basePath>] diff --git a/python/nomadscripts/load_meta_info.py b/common/python/nomadscripts/load_meta_info.py similarity index 100% rename from python/nomadscripts/load_meta_info.py rename to common/python/nomadscripts/load_meta_info.py diff --git a/python/nomadscripts/normalize_meta_info.py b/common/python/nomadscripts/normalize_meta_info.py similarity index 99% rename from python/nomadscripts/normalize_meta_info.py rename to common/python/nomadscripts/normalize_meta_info.py index 41009ece4c8bd43ece4d2577dae2dec71d2cdb5c..9dd29dddc8c02395221a1bff942e06ddc8d81f5e 100755 --- a/python/nomadscripts/normalize_meta_info.py +++ b/common/python/nomadscripts/normalize_meta_info.py @@ -184,7 +184,7 @@ def normalizePaths(paths, checkOnly, force, addGid, addSubGids, extraArgsHandlin return {"paths": paths, "hasErrors": hasErrors, "hasChanges": hasChanges} if __name__ == "__main__": - defaultDir = os.path.normpath(os.path.join(basePath, "../../nomad-meta-info/meta_info/nomad_meta_info")) + defaultDir = os.path.normpath(os.path.join(basePath, "../../../nomad-meta-info/meta_info/nomad_meta_info")) usage = """usage: {command} [--check-only] [--force] [--add-gid] [--add-sub-gids] [--keep-extra-args] [--remove-extra-args] [--error-if-extra-args] [file/or/dir ...] normalizes the InfoKinds file/or/dir (that defalts to {dir})