From b4599b0294501490d098bb7891f4ff8a6f0a6ae5 Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Sun, 26 Jan 2025 08:16:56 +0000 Subject: [PATCH 1/6] MIT licence file & badge in README.md --- LICENSE.md | 22 ++++++++++++++++++++++ README.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..d968d7db --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019-2025 Ádám Fekete, Gábor Csányi, Tamás K. Stenczel, Elena Gelzinyte, +Elliott Kasoar, Alin Marin Elena + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index b6ab1c5d..fdc37224 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ABCD +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Doc](https://img.shields.io/badge/docs-master-green.svg)](https://libatoms.github.io/abcd/) [![Build Status](https://travis-ci.org/libAtoms/abcd.svg?branch=master)](https://travis-ci.org/libAtoms/abcd) From ae88adba3435773892e696f8e5fd851867c96337 Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Sun, 26 Jan 2025 08:57:28 +0000 Subject: [PATCH 2/6] automagically added copyright to all files --- abcd/backends/atoms_http.py | 4 ++++ abcd/backends/atoms_pymongo.py | 4 ++++ abcd/database.py | 4 ++++ abcd/errors.py | 4 ++++ abcd/frontends/commandline/commands.py | 4 ++++ abcd/frontends/commandline/config.py | 4 ++++ abcd/frontends/commandline/decorators.py | 4 ++++ abcd/frontends/commandline/parser.py | 4 ++++ abcd/model.py | 4 ++++ abcd/parsers/extras.py | 4 ++++ abcd/parsers/queries.py | 4 ++++ abcd/parsers/queries_new.py | 4 ++++ abcd/queryset.py | 4 ++++ abcd/server/app/db.py | 4 ++++ abcd/server/app/nav.py | 4 ++++ abcd/server/app/views/api.py | 4 ++++ abcd/server/app/views/database.py | 4 ++++ abcd/server/app/views/index.py | 4 ++++ tests/test_abstract_model.py | 4 ++++ tests/test_database.py | 4 ++++ tests/test_mongodb_srv.py | 4 ++++ tests/test_parsers.py | 4 ++++ tutorials/gb_upload.py | 4 ++++ tutorials/scripts/Preprocess.py | 4 ++++ tutorials/scripts/Reader.py | 4 ++++ tutorials/scripts/Visualise.py | 4 ++++ tutorials/scripts/Visualise_quip.py | 4 ++++ tutorials/test_db.py | 4 ++++ tutorials/test_upload.py | 4 ++++ 29 files changed, 116 insertions(+) diff --git a/abcd/backends/atoms_http.py b/abcd/backends/atoms_http.py index ee62e61a..5033931c 100644 --- a/abcd/backends/atoms_http.py +++ b/abcd/backends/atoms_http.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import json import logging import requests diff --git a/abcd/backends/atoms_pymongo.py b/abcd/backends/atoms_pymongo.py index c2baf7ad..ce87b69a 100644 --- a/abcd/backends/atoms_pymongo.py +++ b/abcd/backends/atoms_pymongo.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel, Gábor Csányi +# This program is distributed under the MIT License, see LICENSE.md. + import types import logging import numpy as np diff --git a/abcd/database.py b/abcd/database.py index 2553583b..7d418f83 100644 --- a/abcd/database.py +++ b/abcd/database.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete +# This program is distributed under the MIT License, see LICENSE.md. + import logging from abc import ABCMeta, abstractmethod diff --git a/abcd/errors.py b/abcd/errors.py index f8cb516d..19384ce6 100644 --- a/abcd/errors.py +++ b/abcd/errors.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete +# This program is distributed under the MIT License, see LICENSE.md. + class ABCDError(Exception): pass diff --git a/abcd/frontends/commandline/commands.py b/abcd/frontends/commandline/commands.py index de158a5c..b27e6024 100644 --- a/abcd/frontends/commandline/commands.py +++ b/abcd/frontends/commandline/commands.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel, Gábor Csányi, Elena Gelzinyte +# This program is distributed under the MIT License, see LICENSE.md. + import logging import os diff --git a/abcd/frontends/commandline/config.py b/abcd/frontends/commandline/config.py index 3aa21bea..0eef7d74 100644 --- a/abcd/frontends/commandline/config.py +++ b/abcd/frontends/commandline/config.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import os import json import logging diff --git a/abcd/frontends/commandline/decorators.py b/abcd/frontends/commandline/decorators.py index c2439be7..4e7a5b0c 100644 --- a/abcd/frontends/commandline/decorators.py +++ b/abcd/frontends/commandline/decorators.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import logging from abcd import ABCD diff --git a/abcd/frontends/commandline/parser.py b/abcd/frontends/commandline/parser.py index 9b2c1af2..2c04b9c0 100644 --- a/abcd/frontends/commandline/parser.py +++ b/abcd/frontends/commandline/parser.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Elena Gelzinyte +# This program is distributed under the MIT License, see LICENSE.md. + import logging from argparse import ArgumentParser from abcd.frontends.commandline import commands diff --git a/abcd/model.py b/abcd/model.py index 4b9dabfd..f744e7b3 100644 --- a/abcd/model.py +++ b/abcd/model.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import datetime import getpass import logging diff --git a/abcd/parsers/extras.py b/abcd/parsers/extras.py index c007acf6..a7ff09d5 100644 --- a/abcd/parsers/extras.py +++ b/abcd/parsers/extras.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import sys from lark import Lark, Transformer, v_args from lark.exceptions import LarkError diff --git a/abcd/parsers/queries.py b/abcd/parsers/queries.py index 41ef1c33..2a2a9155 100644 --- a/abcd/parsers/queries.py +++ b/abcd/parsers/queries.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import logging from lark import Lark, Transformer, v_args from lark.exceptions import LarkError diff --git a/abcd/parsers/queries_new.py b/abcd/parsers/queries_new.py index 22004d11..7e937b27 100644 --- a/abcd/parsers/queries_new.py +++ b/abcd/parsers/queries_new.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import logging from lark import Lark, Transformer, v_args from lark.lexer import Token diff --git a/abcd/queryset.py b/abcd/queryset.py index 82b8ea03..97dfa1d2 100644 --- a/abcd/queryset.py +++ b/abcd/queryset.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete +# This program is distributed under the MIT License, see LICENSE.md. + import logging from abc import ABCMeta diff --git a/abcd/server/app/db.py b/abcd/server/app/db.py index 65bc9c70..71914220 100644 --- a/abcd/server/app/db.py +++ b/abcd/server/app/db.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete +# This program is distributed under the MIT License, see LICENSE.md. + from abcd import ABCD diff --git a/abcd/server/app/nav.py b/abcd/server/app/nav.py index ec8ea2d1..24172148 100644 --- a/abcd/server/app/nav.py +++ b/abcd/server/app/nav.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from flask_nav import Nav from flask_nav.elements import Navbar, View, Separator, Subgroup, Link from hashlib import sha1 diff --git a/abcd/server/app/views/api.py b/abcd/server/app/views/api.py index b3aa6d25..c06b332a 100644 --- a/abcd/server/app/views/api.py +++ b/abcd/server/app/views/api.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from flask import Blueprint, Response, make_response, jsonify, request bp = Blueprint("api", __name__) diff --git a/abcd/server/app/views/database.py b/abcd/server/app/views/database.py index 8569dcd2..8c7d0c07 100644 --- a/abcd/server/app/views/database.py +++ b/abcd/server/app/views/database.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from flask import Blueprint, render_template, request from flask import Response diff --git a/abcd/server/app/views/index.py b/abcd/server/app/views/index.py index 37faa52a..e3119eb1 100644 --- a/abcd/server/app/views/index.py +++ b/abcd/server/app/views/index.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from flask import Blueprint, render_template, url_for # from flask import Blueprint, render_template, flash, redirect, url_for, request diff --git a/tests/test_abstract_model.py b/tests/test_abstract_model.py index f9e820e6..512d016d 100644 --- a/tests/test_abstract_model.py +++ b/tests/test_abstract_model.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import io import ase diff --git a/tests/test_database.py b/tests/test_database.py index 82cddfab..c1e3d78b 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + import pytest import mongomock diff --git a/tests/test_mongodb_srv.py b/tests/test_mongodb_srv.py index bfaf2c8d..f89c11ff 100644 --- a/tests/test_mongodb_srv.py +++ b/tests/test_mongodb_srv.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + """Tests for supporting `mongodb+srv://` URIs""" from pytest import fixture diff --git a/tests/test_parsers.py b/tests/test_parsers.py index 5a2211e0..6b15f52d 100644 --- a/tests/test_parsers.py +++ b/tests/test_parsers.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + import pytest from abcd.parsers.extras import parser as extras_parser from abcd.parsers.queries import parser as queries_parser diff --git a/tutorials/gb_upload.py b/tutorials/gb_upload.py index 3d276de2..500430a9 100644 --- a/tutorials/gb_upload.py +++ b/tutorials/gb_upload.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import sys from pathlib import Path diff --git a/tutorials/scripts/Preprocess.py b/tutorials/scripts/Preprocess.py index 49a315d8..b13cf7a6 100644 --- a/tutorials/scripts/Preprocess.py +++ b/tutorials/scripts/Preprocess.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from pathlib import Path from pprint import pprint import json diff --git a/tutorials/scripts/Reader.py b/tutorials/scripts/Reader.py index 83d6be52..8aa5446c 100644 --- a/tutorials/scripts/Reader.py +++ b/tutorials/scripts/Reader.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from pathlib import Path from pprint import pprint import json diff --git a/tutorials/scripts/Visualise.py b/tutorials/scripts/Visualise.py index 308e76fb..4ae05262 100644 --- a/tutorials/scripts/Visualise.py +++ b/tutorials/scripts/Visualise.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import io import uuid diff --git a/tutorials/scripts/Visualise_quip.py b/tutorials/scripts/Visualise_quip.py index 308e76fb..4ae05262 100644 --- a/tutorials/scripts/Visualise_quip.py +++ b/tutorials/scripts/Visualise_quip.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import io import uuid diff --git a/tutorials/test_db.py b/tutorials/test_db.py index 8a8f34f8..955d885b 100644 --- a/tutorials/test_db.py +++ b/tutorials/test_db.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + from pathlib import Path from ase.io import iread, read diff --git a/tutorials/test_upload.py b/tutorials/test_upload.py index c5fe8e91..98bb1554 100644 --- a/tutorials/test_upload.py +++ b/tutorials/test_upload.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar +# This program is distributed under the MIT License, see LICENSE.md. + import numpy as np from collections import Counter From 1ff6b1cbde0f8b2578cfde646dc3c333ad68dd3d Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Sat, 1 Mar 2025 09:44:42 +0000 Subject: [PATCH 3/6] post-merge formatting, etc. --- LICENSE.md | 2 +- abcd/backends/atoms_pymongo.py | 7 ------- abcd/errors.py | 1 + abcd/frontends/commandline/config.py | 1 - abcd/frontends/commandline/parser.py | 1 - 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index d968d7db..5b635e48 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/abcd/backends/atoms_pymongo.py b/abcd/backends/atoms_pymongo.py index a61e6e3c..84d402f6 100644 --- a/abcd/backends/atoms_pymongo.py +++ b/abcd/backends/atoms_pymongo.py @@ -2,13 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel, Gábor Csányi # This program is distributed under the MIT License, see LICENSE.md. -import types -import logging -import numpy as np - -from typing import Union, Iterable -from os import linesep -from operator import itemgetter from collections import Counter from collections.abc import Iterable from datetime import datetime diff --git a/abcd/errors.py b/abcd/errors.py index 19384ce6..0164603e 100644 --- a/abcd/errors.py +++ b/abcd/errors.py @@ -2,6 +2,7 @@ # Authors: Ádám Fekete # This program is distributed under the MIT License, see LICENSE.md. + class ABCDError(Exception): pass diff --git a/abcd/frontends/commandline/config.py b/abcd/frontends/commandline/config.py index febcf023..fedc462b 100644 --- a/abcd/frontends/commandline/config.py +++ b/abcd/frontends/commandline/config.py @@ -2,7 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar # This program is distributed under the MIT License, see LICENSE.md. -import os import json import logging import os diff --git a/abcd/frontends/commandline/parser.py b/abcd/frontends/commandline/parser.py index 526b6ca2..d2ea4fe4 100644 --- a/abcd/frontends/commandline/parser.py +++ b/abcd/frontends/commandline/parser.py @@ -2,7 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Elena Gelzinyte # This program is distributed under the MIT License, see LICENSE.md. -import logging from argparse import ArgumentParser import logging From 9416fb29c3a13c5e4b604ba8d7a457035fed1af7 Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Sat, 1 Mar 2025 10:03:11 +0000 Subject: [PATCH 4/6] re-run copyright header writing --- abcd/backends/atoms_http.py | 2 +- abcd/database.py | 2 +- abcd/errors.py | 2 +- abcd/frontends/commandline/config.py | 2 +- abcd/frontends/commandline/decorators.py | 2 +- abcd/frontends/commandline/parser.py | 2 +- abcd/model.py | 2 +- abcd/parsers/extras.py | 2 +- abcd/parsers/queries.py | 2 +- abcd/parsers/queries_new.py | 2 +- abcd/queryset.py | 2 +- abcd/server/app/db.py | 2 +- abcd/server/app/nav.py | 2 +- abcd/server/app/views/api.py | 2 +- abcd/server/app/views/database.py | 2 +- abcd/server/app/views/index.py | 2 +- docs_src/conf.py | 4 ++++ tests/hash.py | 4 ++++ tests/test_abstract_model.py | 2 +- tutorials/gb_upload.py | 6 +++++- tutorials/scripts/Preprocess.py | 6 +++++- tutorials/scripts/Reader.py | 6 +++++- tutorials/scripts/Visualise.py | 6 +++++- tutorials/scripts/Visualise_quip.py | 6 +++++- tutorials/test_db.py | 6 +++++- tutorials/test_upload.py | 6 +++++- 26 files changed, 60 insertions(+), 24 deletions(-) diff --git a/abcd/backends/atoms_http.py b/abcd/backends/atoms_http.py index 9c3344d7..da667385 100644 --- a/abcd/backends/atoms_http.py +++ b/abcd/backends/atoms_http.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import json diff --git a/abcd/database.py b/abcd/database.py index 668f08c5..64a36d5d 100644 --- a/abcd/database.py +++ b/abcd/database.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. # ruff: noqa: B024, B027 diff --git a/abcd/errors.py b/abcd/errors.py index 0164603e..53264f84 100644 --- a/abcd/errors.py +++ b/abcd/errors.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete +# Authors: Ádám Fekete, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. diff --git a/abcd/frontends/commandline/config.py b/abcd/frontends/commandline/config.py index fedc462b..283ae587 100644 --- a/abcd/frontends/commandline/config.py +++ b/abcd/frontends/commandline/config.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import json diff --git a/abcd/frontends/commandline/decorators.py b/abcd/frontends/commandline/decorators.py index 6aa2241a..beabd3f8 100644 --- a/abcd/frontends/commandline/decorators.py +++ b/abcd/frontends/commandline/decorators.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import logging diff --git a/abcd/frontends/commandline/parser.py b/abcd/frontends/commandline/parser.py index d2ea4fe4..d8ead232 100644 --- a/abcd/frontends/commandline/parser.py +++ b/abcd/frontends/commandline/parser.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Elena Gelzinyte +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel, Elena Gelzinyte # This program is distributed under the MIT License, see LICENSE.md. from argparse import ArgumentParser diff --git a/abcd/model.py b/abcd/model.py index 82a3f18c..5247738c 100644 --- a/abcd/model.py +++ b/abcd/model.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from collections import Counter, UserDict diff --git a/abcd/parsers/extras.py b/abcd/parsers/extras.py index 9e068510..8d5db3d4 100644 --- a/abcd/parsers/extras.py +++ b/abcd/parsers/extras.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. # ruff: noqa: E731 diff --git a/abcd/parsers/queries.py b/abcd/parsers/queries.py index 0991ec9c..5a88815a 100644 --- a/abcd/parsers/queries.py +++ b/abcd/parsers/queries.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. # ruff: noqa: E731 diff --git a/abcd/parsers/queries_new.py b/abcd/parsers/queries_new.py index 7c5b508b..253b84f6 100644 --- a/abcd/parsers/queries_new.py +++ b/abcd/parsers/queries_new.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import logging diff --git a/abcd/queryset.py b/abcd/queryset.py index 647b8efe..7824b44a 100644 --- a/abcd/queryset.py +++ b/abcd/queryset.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from abc import ABCMeta diff --git a/abcd/server/app/db.py b/abcd/server/app/db.py index 70f9bb66..f0f1e0fe 100644 --- a/abcd/server/app/db.py +++ b/abcd/server/app/db.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from abcd import ABCD diff --git a/abcd/server/app/nav.py b/abcd/server/app/nav.py index d13a1b61..d09a7d70 100644 --- a/abcd/server/app/nav.py +++ b/abcd/server/app/nav.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from flask_nav import Nav diff --git a/abcd/server/app/views/api.py b/abcd/server/app/views/api.py index 66c36f53..61a9a5f6 100644 --- a/abcd/server/app/views/api.py +++ b/abcd/server/app/views/api.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from flask import Blueprint, Response, jsonify, request diff --git a/abcd/server/app/views/database.py b/abcd/server/app/views/database.py index bb998f6c..60922e33 100644 --- a/abcd/server/app/views/database.py +++ b/abcd/server/app/views/database.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from flask import Blueprint, Response, render_template, request diff --git a/abcd/server/app/views/index.py b/abcd/server/app/views/index.py index e3119eb1..1fde34ec 100644 --- a/abcd/server/app/views/index.py +++ b/abcd/server/app/views/index.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from flask import Blueprint, render_template, url_for diff --git a/docs_src/conf.py b/docs_src/conf.py index 4eddd064..4f734d66 100644 --- a/docs_src/conf.py +++ b/docs_src/conf.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Elliott Kasoar, Tamás K. Stenczel, Gábor Csányi +# This program is distributed under the MIT License, see LICENSE.md. + # # Configuration file for the Sphinx documentation builder. # diff --git a/tests/hash.py b/tests/hash.py index c29e5a23..51062cf8 100644 --- a/tests/hash.py +++ b/tests/hash.py @@ -1,3 +1,7 @@ +# Copyright (c) 2025. +# Authors: Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + import io import ase diff --git a/tests/test_abstract_model.py b/tests/test_abstract_model.py index 7664b70b..96bd3efa 100644 --- a/tests/test_abstract_model.py +++ b/tests/test_abstract_model.py @@ -1,5 +1,5 @@ # Copyright (c) 2025. -# Authors: Elliott Kasoar +# Authors: Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import datetime diff --git a/tutorials/gb_upload.py b/tutorials/gb_upload.py index 2bf2c80f..e64ca284 100644 --- a/tutorials/gb_upload.py +++ b/tutorials/gb_upload.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import sys diff --git a/tutorials/scripts/Preprocess.py b/tutorials/scripts/Preprocess.py index 724d1104..8bc584b8 100644 --- a/tutorials/scripts/Preprocess.py +++ b/tutorials/scripts/Preprocess.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from pathlib import Path diff --git a/tutorials/scripts/Reader.py b/tutorials/scripts/Reader.py index f074f5f0..8c272091 100644 --- a/tutorials/scripts/Reader.py +++ b/tutorials/scripts/Reader.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import json diff --git a/tutorials/scripts/Visualise.py b/tutorials/scripts/Visualise.py index 3a62e2b3..55e9a61e 100644 --- a/tutorials/scripts/Visualise.py +++ b/tutorials/scripts/Visualise.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import io diff --git a/tutorials/scripts/Visualise_quip.py b/tutorials/scripts/Visualise_quip.py index 3a62e2b3..55e9a61e 100644 --- a/tutorials/scripts/Visualise_quip.py +++ b/tutorials/scripts/Visualise_quip.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. import io diff --git a/tutorials/test_db.py b/tutorials/test_db.py index 7cca3ac3..129b0254 100644 --- a/tutorials/test_db.py +++ b/tutorials/test_db.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from pathlib import Path diff --git a/tutorials/test_upload.py b/tutorials/test_upload.py index 7ac873e2..b572b3c1 100644 --- a/tutorials/test_upload.py +++ b/tutorials/test_upload.py @@ -1,5 +1,9 @@ # Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +# Copyright (c) 2025. +# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. from abcd import ABCD From af7d48058c0235b71a3dc3213c75bf7e8685166d Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Sat, 1 Mar 2025 10:05:40 +0000 Subject: [PATCH 5/6] include the program used for creating copyright headers --- devtools/update_copyright.py | 94 ++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 devtools/update_copyright.py diff --git a/devtools/update_copyright.py b/devtools/update_copyright.py new file mode 100644 index 00000000..1ebaf82c --- /dev/null +++ b/devtools/update_copyright.py @@ -0,0 +1,94 @@ +# Copyright (c) 2025. +# Authors: Tamás K. Stenczel +# This program is distributed under the MIT License, see LICENSE.md. + +"""Add or update copyright notice to all python files.""" + +from datetime import date +import os +import re +import subprocess + +# git users -> real name mapping for current contributors +USER_TO_REAL_NAME = { + "stenczelt": "Tamás K. Stenczel", + "Tamas K Stenczel": "Tamás K. Stenczel", + "Tamas Stenczel": "Tamás K. Stenczel", + "T. K. Stenczel": "Tamás K. Stenczel", + "Adam Fekete": "Ádám Fekete", + "ElliottKasoar": "Elliott Kasoar", + "gelzinyte": "Elena Gelzinyte", + "gabor1": "Gábor Csányi", + "gabor": "Gábor Csányi", +} + + +def get_contributors(file_path): + """Get list of contributors for a given file.""" + command = f"git log --pretty=format:'%an' {file_path} | sort | uniq" + contributors = subprocess.check_output(command, shell=True, text=True) + contributors = contributors.strip().split("\n") + + # Map usernames to real names, if possible + real_name_contributors = [] + for contributor in contributors: + if contributor == "": + continue + real_name = USER_TO_REAL_NAME[contributor] + if real_name not in real_name_contributors: + real_name_contributors.append(real_name) + + return real_name_contributors + + +def insert_copyright(file_path, contributors): + """Insert a copyright notice at the top of a file.""" + # Create the copyright notice string + author_names = ", ".join(contributors) + copyright_notice = ( + f"# Copyright (c) {date.today().year}.\n" + f"# Authors: {author_names}\n" + f"# This program is distributed under the MIT License, see LICENSE.md.\n\n" + ) + + with open(file_path) as file: + content = file.read() + + # replace existing notice if needed + pattern = re.compile( + r"^# Copyright \(c\) [\d-]+\.\n" + r"# Authors:\s*(.*?)\n" + r"# This program is distributed under the MIT License, see LICENSE\.md\.\n\n", + re.MULTILINE, + ) + + if m := pattern.match(content): + if m.group(1) == author_names: + print(file_path, "Matched! contributors unchanged") + else: + print(file_path, "Updating contributors: ", m.group(1), " ->", author_names) + content = pattern.sub(copyright_notice, content) + else: + print(file_path, "adding contributors", author_names) + content = copyright_notice + content + + # Insert the copyright notice at the top + with open(file_path, "w") as file: + file.write(content) + + +def process_files(directory): + """Process all Python files in the given directory.""" + for root, _, files in os.walk(directory): + if root.startswith("./.venv"): + continue + for file in files: + if file.endswith(".py") and file != "__init__.py": + file_path = os.path.join(root, file) + contributors = get_contributors(file_path) + insert_copyright(file_path, contributors) + + +if __name__ == "__main__": + # Replace with your folder path + process_files(".") From fa7b579ce469cd8a4b715ebf51f0248ba5d3b9ce Mon Sep 17 00:00:00 2001 From: Tamas K Stenczel Date: Thu, 26 Jun 2025 07:06:18 +0100 Subject: [PATCH 6/6] remove duplicate headers --- tutorials/gb_upload.py | 4 ---- tutorials/scripts/Preprocess.py | 4 ---- tutorials/scripts/Reader.py | 4 ---- tutorials/scripts/Visualise.py | 4 ---- tutorials/scripts/Visualise_quip.py | 4 ---- tutorials/test_db.py | 4 ---- tutorials/test_upload.py | 4 ---- 7 files changed, 28 deletions(-) diff --git a/tutorials/gb_upload.py b/tutorials/gb_upload.py index e64ca284..acaa8328 100644 --- a/tutorials/gb_upload.py +++ b/tutorials/gb_upload.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - import sys from pathlib import Path import sys diff --git a/tutorials/scripts/Preprocess.py b/tutorials/scripts/Preprocess.py index 8bc584b8..91280f7a 100644 --- a/tutorials/scripts/Preprocess.py +++ b/tutorials/scripts/Preprocess.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - from pathlib import Path from pprint import pprint import json diff --git a/tutorials/scripts/Reader.py b/tutorials/scripts/Reader.py index 8c272091..3da9f78c 100644 --- a/tutorials/scripts/Reader.py +++ b/tutorials/scripts/Reader.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - import json from pathlib import Path diff --git a/tutorials/scripts/Visualise.py b/tutorials/scripts/Visualise.py index 55e9a61e..2ab22146 100644 --- a/tutorials/scripts/Visualise.py +++ b/tutorials/scripts/Visualise.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - import io import uuid diff --git a/tutorials/scripts/Visualise_quip.py b/tutorials/scripts/Visualise_quip.py index 55e9a61e..2ab22146 100644 --- a/tutorials/scripts/Visualise_quip.py +++ b/tutorials/scripts/Visualise_quip.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - import io import uuid diff --git a/tutorials/test_db.py b/tutorials/test_db.py index 129b0254..43f1bc3a 100644 --- a/tutorials/test_db.py +++ b/tutorials/test_db.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - from pathlib import Path from ase.io import read diff --git a/tutorials/test_upload.py b/tutorials/test_upload.py index b572b3c1..540d517f 100644 --- a/tutorials/test_upload.py +++ b/tutorials/test_upload.py @@ -2,10 +2,6 @@ # Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel # This program is distributed under the MIT License, see LICENSE.md. -# Copyright (c) 2025. -# Authors: Ádám Fekete, Elliott Kasoar, Tamás K. Stenczel -# This program is distributed under the MIT License, see LICENSE.md. - from abcd import ABCD if __name__ == "__main__":