Materials-Data-Science-and-Informatics / somesy

A CLI tool for synchronizing software project metadata
https://materials-data-science-and-informatics.github.io/somesy/main/
MIT License
12 stars 2 forks source link

Codemeta support #16

Closed apirogov closed 1 year ago

apirogov commented 1 year ago
apirogov commented 1 year ago

When I run somesy sync in this repo itself, it deletes my email in codemeta.json. Is it the expected behavior?

Interesting, nice catch. Its apparently behavior of codemetapy - seems to not manage to merge the persons properly, too :D cffconvert creates a codemeta with the orcid, codemeta extracts email from pyproject, and when you "combine" them, it keeps just one of those things.

Don't know if its a bug or intended, but not a problem with somesy.

apirogov commented 1 year ago

While refactoring, I also changed some stuff with the config logic.

  1. The config has no "optional" fields. The config is complete. Optional fields are "partial" configurations (that we have no explicit model for). In the resulting config everything is non-optional (i.e. every field has a well-defined value)
  2. I moved validation logic into the model, where it belongs
  3. I removed the "if path is set, change flag to false" thing, it was causing problems and I can see situations like you set the file in a config, but disable the sync in the cli, and this would lead to surprising behavior. I think setting the path and enabling sync are orthogonal things.
  4. I refactored in a way to avoid lots of duplications in the code
apirogov commented 1 year ago

when I run the command somesy sync codemeta.json changes as below

diff --git a/codemeta.json b/codemeta.json
index 37a734c..d4675f5 100644
--- a/codemeta.json
+++ b/codemeta.json
@@ -11,17 +11,17 @@
     "audience": [
         {
             "@type": "Audience",
-            "audienceType": "Developers"
+            "audienceType": "Science/Research"
         },
         {
             "@type": "Audience",
-            "audienceType": "Science/Research"
+            "audienceType": "Developers"
         }
     ],
     "author": [
         {
+            "@id": "https://orcid.org/0000-0003-2637-0432",
             "@type": "Person",
-            "email": "m.soylu@fz-juelich.de",
             "familyName": "Soylu",
             "givenName": "Mustafa"
         }

Yeah, because the graph changed (email out, orcid in). When you run it again, it should not update it again.

mustafasoylu commented 1 year ago

Yeah, because the graph changed (email out, orcid in). When you run it again, it should not update it again.

Sorry, I don't understand it, Email is recorded in somesy config file, cff file and pyproject file so it should be in codemeta.json, right?