You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONVENTIONS.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# ESMF SDK PY Aspect Model Loader Code Conventions
2
2
3
-
The following document contains a compilation of conventions and guidelines to format, structure and write code for the ESMF SDK PY Aspect Model Loader.
3
+
The following document contains a compilation of conventions and guidelines to format,
4
+
structure and write code for the ESMF SDK PY Aspect Model Loader.
4
5
5
6
## General Conventions
6
7
Our code conventions are based on the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) but
`Poetry` used as a dependency management for the `esmf-aspect-model-loader`. Follow the next [instruction](https://python-poetry.org/docs/#installation)
44
+
to install it.
45
+
46
+
To check the poetry version run:
47
+
```console
48
+
poetry --version
26
49
```
27
50
28
-
##Automatic Deployment
51
+
### Install project dependencies
29
52
30
-
A [GitHub action called 'Release'](https://github.com/eclipse-esmf/esmf-sdk-py-aspect-model-loader/actions/workflows/tagged_release.yml)
31
-
has been set up for the `esmf-aspect-model-loader`. This action checks the code quality by running tests, the [static type checker MyPy](https://github.com/python/mypy) and
32
-
the [code formatter 'Black'](https://github.com/psf/black).
53
+
Poetry provides convenient functionality for working with dependencies in the project.
54
+
To automatically download and install all the necessary libraries, just run one command:
55
+
```console
56
+
poetry install
57
+
```
58
+
It is required to run `poetry install` once in the esmf-aspect-model-loader module.
33
59
34
-
##Set Up SAMM Aspect Meta Model for development
60
+
### Download SAMM files
35
61
36
-
In order to download the SAMM sources, it is required to run `poetry install` once in the `esmf-aspect-model-loader`
37
-
module. There are two possibilities to download the SAMM files and extract the Turtle sources for the Meta Model.
62
+
There are two possibilities to download the SAMM files and extract the Turtle sources for the Meta Model:
63
+
SAMM release or SAMM branch
38
64
39
-
###Possibility 1 (downloading a release)
65
+
#### Download SAMM release
40
66
41
-
The `download_samm_release`script may be executed with
67
+
This script downloads a release JAR-file from GitHub, extracts them for further usage in the Aspect Model Loader:
42
68
43
-
```
69
+
To run script, execute the next command.
70
+
```console
44
71
poetry run download-samm-release
45
-
```
46
-
47
-
It downloads a release JAR-file from GitHub and extracts the SAMM Files.
48
-
The version is specified in the python script.
49
-
50
-
Link to all Releases: https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/releases
72
+
```
73
+
The version of the SAMM release is specified in the python script.
51
74
52
-
### Possibility 2 (downloading from the repository)
75
+
Link to all Releases: [SAMM Releases](https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/releases)
53
76
54
-
It may happen that there is no .jar file that is up to date with the changes of the SAMM.
55
-
This script is an alternative to the `download_samm_release.py` and extracts the files from the repository
56
-
directly instead of using the newest release.
77
+
#### Download SAMM branch
57
78
58
-
The script uses the GitHub API and downloads the files from the `main` branch. If the script is run in a
59
-
pipeline, it uses a GitHub token to authorize. If the script is run locally, the API is called without a token.
60
-
This may cause problems because unauthorized API calls are limited.
79
+
The script uses the GitHub API and downloads the files from the `main` GitHub branch.
61
80
62
-
This script can be executed with
81
+
If the script is run in a pipeline, it uses a GitHub token to authorize. If the script is run locally,
82
+
the API is called without a token. This may cause problems because unauthorized API calls are limited.
63
83
64
-
```
84
+
Run the next command to download and start working with the Aspect Model Loader.
85
+
```console
65
86
poetry run download-samm-branch
66
87
```
67
-
to download and start working with the Aspect Model Loader.
88
+
Link to all branches: [SAMM Releases](https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/branches)
68
89
69
-
## Semantic Aspect Meta Model
90
+
## Aspect Meta Model Loader usage
70
91
71
-
To be able to use SAMM meta model classes you need to download the corresponding files.
72
-
Details are described in [Set up SAMM Aspect Meta Model for development](#set-up-samm-aspect-meta-model-for-development).
92
+
An Aspect of the Meta Model can be loaded as follows:
93
+
```python
94
+
from esmf_aspect_meta_model_python import AspectLoader
This module contains classes for working with Aspect data.
100
+
# or you can provide an Aspect URN
75
101
76
-
SAMM meta model contains:
77
-
- SammUnitsGraph: provide a functionality for working with units([units.ttl](./esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/unit/2.1.0/units.ttl)) data
0 commit comments