Skip to content

Commit a47ca93

Browse files
authored
Merge pull request #43 from Materials-Data-Science-and-Informatics/dev
Some fixes, added metadata, added `publication_author` flag, added `somesy fill` command
2 parents d1cc088 + e9331d6 commit a47ca93

22 files changed

Lines changed: 423 additions & 101 deletions

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@ repos:
8282
- repo: local
8383
hooks:
8484
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
85-
- id: somesy
86-
name: somesy
85+
- id: somesy-sync
86+
name: Run somesy sync
8787
entry: somesy sync
8888
language: python
8989
files: '^\.somesy\.toml|pyproject\.toml$'
9090
pass_filenames: false
91+
92+
- id: somesy-fill
93+
name: Update AUTHORS.md
94+
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
95+
language: python
96+
files: '^\.somesy\.toml|pyproject\.toml$'
97+
pass_filenames: false

.pre-commit-hooks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- id: somesy
22
name: somesy
33
description: Sync your metadata files with somesy
4-
entry: somesy sync
4+
entry: somesy
5+
args: ["sync"]
56
language: python
67
files: '^somesy\.toml|\.somesy\.toml|pyproject\.toml|package\.json$'
78
pass_filenames: false

.somesy.toml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ given-names = "Mustafa"
1313
email = "m.soylu@fz-juelich.de"
1414
orcid = "https://orcid.org/0000-0003-2637-0432"
1515

16-
contribution = "The main developer, maintainer and tester."
16+
contribution = "Main developer, maintainer and tester."
1717
contribution_begin = "2023-03-01"
1818
contribution_types = ["maintenance", "code", "test", "review", "doc"]
1919

@@ -26,7 +26,7 @@ given-names = "Anton"
2626
email = "a.pirogov@fz-juelich.de"
2727
orcid = "https://orcid.org/0000-0002-5077-7497"
2828

29-
contribution = "Initial concepts, tool development and enhancement, documentation."
29+
contribution = "Concepts, tool development and enhancement, documentation."
3030
contribution_begin = "2023-03-01"
3131
contribution_types = ["ideas", "code", "test", "review", "doc"]
3232

@@ -38,10 +38,34 @@ given-names = "Jens"
3838
email = "j.broeder@fz-juelich.de"
3939
orcid = "https://orcid.org/0000-0001-7939-226X"
4040

41-
contribution = "Valuable input concerning metadata standards and usability."
41+
contribution = "Discussions and suggestions concerning metadata standards and usability."
4242
contribution_begin = "2023-03-01"
43+
contribution_end = "2023-03-31"
4344
contribution_types = ["ideas"]
4445

46+
[[project.people]]
47+
family-names = "Hofmann"
48+
given-names = "Volker"
49+
email = "v.hofmann@fz-juelich.de"
50+
orcid = "https://orcid.org/0000-0002-5149-603X"
51+
52+
contribution = "Discussions and suggestions concerning tool scope and usability."
53+
contribution_begin = "2023-06-01"
54+
contribution_end = "2023-06-30"
55+
contribution_types = ["ideas"]
56+
57+
publication_author = true
58+
59+
[[project.people]]
60+
family-names = "Sandfeld"
61+
given-names = "Stefan"
62+
email = "s.sandfeld@fz-juelich.de"
63+
orcid = "https://orcid.org/0000-0001-9560-4728"
64+
65+
contribution_types = ["fundingFinding"]
66+
67+
publication_author = true
68+
4569
[config]
4670
no_sync_cff = false
4771
cff_file = "CITATION.cff"

AUTHORS.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
# Authors and Contributors
22

3-
**Main authors** are persons whose contributions significantly shaped
4-
the state of the software at some point in time.
3+
**Authors** are people whose contributions significantly shaped
4+
the state of `somesy` at some point in time.
55

6-
**Additional contributors** are persons who are not main authors,
7-
but contributed non-trivially to this project,
8-
e.g. by providing smaller fixes and enhancements to the code and/or documentation.
6+
**Additional contributors** are people who contributed non-trivially to this project
7+
in different ways, e.g. by providing smaller fixes and enhancements to the code
8+
and/or documentation.
99

1010
Of course, this is just a rough overview and categorization.
1111
For a more complete overview of all contributors and contributions,
1212
please inspect the git history of this repository.
1313

14-
## Main Authors
14+
## Authors
1515

1616
- Mustafa Soylu (
1717
[E-Mail](mailto:m.soylu@fz-juelich.de),
1818
[ORCID](https://orcid.org/0000-0003-2637-0432)
19-
): original author
20-
19+
): Main developer, maintainer and tester.
2120
- Anton Pirogov (
2221
[E-Mail](mailto:a.pirogov@fz-juelich.de),
2322
[ORCID](https://orcid.org/0000-0002-5077-7497)
24-
): documentation, review, and ideas
23+
): Concepts, tool development and enhancement, documentation.
2524

26-
## Additional Contributors
2725

28-
<!--
29-
- Name (E-mail, ORCID):
30-
Summary of contribution
31-
-->
26+
## Additional Contributors
3227

3328
- Jens Bröder (
3429
[E-Mail](mailto:j.broeder@fz-juelich.de),
3530
[ORCID](https://orcid.org/0000-0001-7939-226X)
36-
): ideas
37-
38-
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/main/contributing)**?
31+
): Discussions and suggestions concerning metadata standards and usability.
32+
- Volker Hofmann (
33+
[E-Mail](mailto:v.hofmann@fz-juelich.de),
34+
[ORCID](https://orcid.org/0000-0002-5149-603X)
35+
): Discussions and suggestions concerning tool scope and usability.
36+
- Stefan Sandfeld (
37+
[E-Mail](mailto:s.sandfeld@fz-juelich.de),
38+
[ORCID](https://orcid.org/0000-0001-9560-4728)
39+
)
40+
41+
42+
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/latest/contributing)**?

CITATION.cff

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ keywords:
1111
- metadata
1212
- FAIR
1313
authors:
14-
- email: m.soylu@fz-juelich.de
15-
family-names: Soylu
14+
- orcid: https://orcid.org/0000-0003-2637-0432
15+
email: m.soylu@fz-juelich.de
1616
given-names: Mustafa
17-
orcid: https://orcid.org/0000-0003-2637-0432
17+
family-names: Soylu
18+
- email: v.hofmann@fz-juelich.de
19+
orcid: https://orcid.org/0000-0002-5149-603X
20+
family-names: Hofmann
21+
given-names: Volker
22+
- email: s.sandfeld@fz-juelich.de
23+
orcid: https://orcid.org/0000-0001-9560-4728
24+
family-names: Sandfeld
25+
given-names: Stefan
1826
- email: a.pirogov@fz-juelich.de
27+
orcid: https://orcid.org/0000-0002-5077-7497
1928
family-names: Pirogov
2029
given-names: Anton
21-
orcid: https://orcid.org/0000-0002-5077-7497
2230
contact:
2331
- email: m.soylu@fz-juelich.de
2432
family-names: Soylu

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ keywords = ["some", "descriptive", "keywords"]
7171
license = "MIT"
7272
repository = "https://github.com/username/my-amazing-project"
7373

74-
# This is you, the proud author of your project
74+
# This is you, the proud author of your project:
7575
[[project.people]]
7676
given-names = "Jane"
7777
family-names = "Doe"
@@ -80,12 +80,14 @@ orcid = "https://orcid.org/0000-0000-0000-0001"
8080
author = true # is a full author of the project (i.e. appears in citations)
8181
maintainer = true # currently maintains the project (i.e. is a contact person)
8282

83-
# this person is a acknowledged contributor, but not author or maintainer:
83+
# this person is an acknowledged contributor, but not author or maintainer:
8484
[[project.people]]
8585
given-names = "Another"
8686
family-names = "Contributor"
8787
email = "a.contributor@example.com"
8888
orcid = "https://orcid.org/0000-0000-0000-0002"
89+
# ... but for scientific publications, this contributor should be listed as author:
90+
publication_author = true
8991

9092
[config]
9193
verbose = true # show detailed information about what somesy is doing
@@ -151,17 +153,16 @@ Here is an overview of all the currently supported files and formats.
151153
| Input Formats | Status | | Target Formats | Status |
152154
| -------------- | ------ |-| ----------------------------- | ------ |
153155
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
154-
| pyproject.toml | ✓(1.) | | pyproject.toml _(setuptools)_ | ✓(2.) |
155-
| package.json | ✓ | | package.json | ✓(3.) |
156+
| pyproject.toml | ✓ | | pyproject.toml _(setuptools)_ | ✓(1.) |
157+
| package.json | ✓ | | package.json | ✓(2.) |
156158
| | | | CITATION.cff | ✓ |
157-
| | | | codemeta.json | ✓(4.) |
159+
| | | | codemeta.json | ✓(3.) |
158160

159161
**Notes:**
160162

161-
1. information must be placed inside a `tool.somesy` section (as explained above)
162-
2. note that `somesy` does not support setuptools *dynamic fields*
163-
3. `package.json` only supports one author, so `somesy` will pick the *first* listed author
164-
4. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. do not edit it by hand!)
163+
1. note that `somesy` does not support setuptools *dynamic fields*
164+
2. `package.json` only supports one author, so `somesy` will pick the *first* listed author
165+
3. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. do not edit it by hand!)
165166

166167
<!-- --8<-- [end:quickstart] -->
167168

codemeta.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@
2525
"familyName": "Soylu",
2626
"givenName": "Mustafa"
2727
},
28+
{
29+
"@id": "https://orcid.org/0000-0002-5149-603X",
30+
"@type": "Person",
31+
"familyName": "Hofmann",
32+
"givenName": "Volker"
33+
},
34+
{
35+
"@id": "https://orcid.org/0000-0001-9560-4728",
36+
"@type": "Person",
37+
"familyName": "Sandfeld",
38+
"givenName": "Stefan"
39+
},
2840
{
2941
"@id": "https://orcid.org/0000-0002-5077-7497",
3042
"@type": "Person",
@@ -49,14 +61,14 @@
4961
"identifier": "'version':",
5062
"name": "'version':",
5163
"runtimePlatform": "Python 3",
52-
"version": "'^0.7.0'}"
64+
"version": "'^1.9.2'}"
5365
},
5466
{
5567
"@type": "SoftwareApplication",
5668
"identifier": "'version':",
5769
"name": "'version':",
5870
"runtimePlatform": "Python 3",
59-
"version": "'^1.9.2'}"
71+
"version": "'^0.7.0'}"
6072
},
6173
{
6274
"@type": "SoftwareApplication",
@@ -79,6 +91,13 @@
7991
"runtimePlatform": "Python 3",
8092
"version": "^4.11.0"
8193
},
94+
{
95+
"@type": "SoftwareApplication",
96+
"identifier": "jinja2",
97+
"name": "jinja2",
98+
"runtimePlatform": "Python 3",
99+
"version": "^3.1.2"
100+
},
82101
{
83102
"@type": "SoftwareApplication",
84103
"identifier": "packaging",

docs/_template_authors.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Authors and Contributors
2+
3+
**Authors** are people whose contributions significantly shaped
4+
the state of `{{ project.name }}` at some point in time.
5+
6+
**Additional contributors** are people who contributed non-trivially to this project
7+
in different ways, e.g. by providing smaller fixes and enhancements to the code
8+
and/or documentation.
9+
10+
Of course, this is just a rough overview and categorization.
11+
For a more complete overview of all contributors and contributions,
12+
please inspect the git history of this repository.
13+
14+
## Authors
15+
16+
{% for p in project.authors() %}
17+
{%- set contr_desc = p.contribution or "" -%}
18+
- {{ p.full_name }} (
19+
[E-Mail](mailto:{{ p.email }}),
20+
[ORCID]({{ p.orcid }})
21+
){{ ": "+contr_desc if contr_desc else "" }}
22+
{% endfor %}
23+
24+
## Additional Contributors
25+
26+
{% for p in project.contributors() %}
27+
{%- set contr_desc = p.contribution or "" -%}
28+
- {{ p.full_name }} (
29+
[E-Mail](mailto:{{ p.email }}),
30+
[ORCID]({{ p.orcid }})
31+
){{ ": "+contr_desc if contr_desc else "" }}
32+
{% endfor %}
33+
34+
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/latest/contributing)**?
35+

docs/manual.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,37 @@ target is enabled, `somesy` will generate your `codemeta.json` by:
387387
As `codemeta.json` is considered a technical "backend-format" derived from other
388388
inputs, in most cases you probably do not need or should edit it by hand anyway.
389389

390+
## Using somesy to insert metadata into project documentation
391+
392+
While `somesy` can synchronize structured metadata files and formats, there is a common case that cannot be covered by the `sync` command - when project metadata should appear in plain text documents, such as documentation files and web pages.
393+
394+
As for documentation the needs and used tooling in different projects is vastly different, `somesy` provides a very general solution to this problem
395+
with the `fill` command. It takes a
396+
[Jinja2](https://jinja.palletsprojects.com/en/3.1.x/)
397+
template and returns the resulting file where the project metadata is inserted the form dictated by the template.
398+
399+
For example, a template is used to generate the
400+
[`AUTHORS.md`](https://github.com/Materials-Data-Science-and-Informatics/somesy/blob/main/AUTHORS.md)
401+
file in the somesy repository, which is also shown as the
402+
[Credits](./credits.md) page, using the following command:
403+
404+
```shell
405+
somesy fill docs/_template_authors.md -o AUTHORS.md
406+
```
407+
408+
??? example "_template_authors.md"
409+
```
410+
--8<-- "docs/_template_authors.md"
411+
```
412+
413+
??? example "AUTHORS.md"
414+
```
415+
--8<-- "AUTHORS.md"
416+
```
417+
418+
The template gets the complete
419+
[ProjectMetadata](reference/somesy/core/models.md#somesy.core.models.ProjectMetadata) as its context, so it is possible to access all included project and contributor information.
420+
390421
## FAQ
391422

392423
### Somesy introduces it's own metadata format... isn't this counter-productive?
@@ -406,3 +437,21 @@ hood, you use `somesy` (or anything like it) or not - they can use the
406437
corresponding files they already know to get the information they need.
407438
So there is no "risk" involved in adopting `somesy`, because it does not try to
408439
abolish any other formats or standards or becoming such.
440+
441+
### In my project, the effective authors and the publication authors are not the same! What to do?
442+
443+
The `author` flag in `somesy` is intended to mark people who significantly contributed
444+
to the project in a hands-on way and are closely familiar with details, i.e. can answer
445+
specific questions. A reason to stick with this strict understanding of "author"
446+
is that a user will be usually interested in contacting such a person to help
447+
them with problems.
448+
449+
However, we are aware that acknowledgement practices in different scientific
450+
communities vary and current practices in academic publication do not allow for
451+
sufficiently granular distinction of contributor roles.
452+
Even though the proper solution to problem would be improving community practices,
453+
`somesy` supports the `publication_author` flag, that can be set independently of the
454+
`author` flag and will make sure that certain contributors **will** appear as authors
455+
in an academic citation context (i.e. reflected in the `CITATION.cff` file, which can be
456+
used for [Zenodo publications](https://docs.software-metadata.pub/en/latest/tutorials/automated-publication-with-ci.html)), but **will not** appear as authors in a technical context
457+
(such as the metadata in a software registry like [PyPI](https://pypi.org)).

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ plugins:
143143
enabled: !ENV [OFFLINE, false]
144144
# to make multi-version docs work right
145145
- mike
146+
- exclude:
147+
glob:
148+
- "_*.md" # for internal purposes
146149

147150
hooks:
148151
- docs/scripts/coverage_status.py

0 commit comments

Comments
 (0)