From 203f76339f20468606a0f1252f69c3e0ae12c5ea Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila <37295697+m-fila@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:15:57 +0100 Subject: [PATCH] Fix more typos (#571) * Fix typos in comments * fix more typos --- .gitignore | 1 + CMakeLists.txt | 2 +- cmake/podioBuild.cmake | 4 ++-- cmake/podioMacros.cmake | 10 +++++----- doc/datamodel_syntax.md | 2 +- doc/templates.md | 2 +- env.sh | 4 ++-- include/podio/DatamodelRegistry.h | 2 +- include/podio/utilities/TypeHelpers.h | 4 ++-- python/podio/test_Reader.py | 6 +++--- python/podio_gen/cpp_generator.py | 6 +++--- python/podio_gen/generator_base.py | 4 ++-- python/podio_gen/generator_utils.py | 2 +- python/podio_gen/podio_config_reader.py | 6 +++--- python/podio_gen/test_ClassDefinitionValidator.py | 2 +- python/podio_gen/test_DataModelJSONEncoder.py | 4 ++-- python/templates/Collection.cc.jinja2 | 6 +++--- python/templates/CollectionData.h.jinja2 | 2 +- python/templates/Interface.h.jinja2 | 2 +- tools/podio-ttree-to-rntuple | 4 ++-- 20 files changed, 38 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index f8089d4d8..2542747ac 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ spack* /compile_commands.json .vscode /.cache/ +.venv # Generated files *podio_generated_files.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index f43a60930..43a1cd67f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ SET( ${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME # Provides install directory variables as defined for GNU software include(GNUInstallDirs) -# Define a default build type can be overriden by passing +# Define a default build type can be overridden by passing # ``-DCMAKE_BUILD_TYPE=`` when invoking CMake if(NOT CMAKE_CONFIGURATION_TYPES) if(NOT CMAKE_BUILD_TYPE) diff --git a/cmake/podioBuild.cmake b/cmake/podioBuild.cmake index acbf2a5e1..4c9317009 100644 --- a/cmake/podioBuild.cmake +++ b/cmake/podioBuild.cmake @@ -27,7 +27,7 @@ macro(podio_set_rpath) if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}") endif("${isSystemDir}" STREQUAL "-1") - # Make sure to actualy set RPATH and not RUNPATH by disabling the new dtags + # Make sure to actually set RPATH and not RUNPATH by disabling the new dtags # explicitly. Set executable and shared library linker flags for this set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-new-dtags") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags") @@ -145,7 +145,7 @@ macro(ADD_SANITIZER_FLAGS) message(FATAL_ERROR "Unsupported value for USE_SANITIZER: ${USE_SANITIZER}") endif() - # Set a few more flags if we have succesfully configured a sanitizer + # Set a few more flags if we have successfully configured a sanitizer # For nicer stack-traces in the output add_compile_options("-fno-omit-frame-pointer") # append_flag( CMAKE_CXX_FLAGS CMAKE_C_FLAGS) diff --git a/cmake/podioMacros.cmake b/cmake/podioMacros.cmake index 0fd0bee39..c48f28d81 100644 --- a/cmake/podioMacros.cmake +++ b/cmake/podioMacros.cmake @@ -5,8 +5,8 @@ # if dictionary is a TARGET (e.g., created with add_library), we inherit the INCLUDE_DIRECTORES and # COMPILE_DEFINITIONS properties # -# This is a copy from RELFEX_GENERATE_DICTIONARY from the RootMacros in Root v6.22 -# Copied here to allow creating dictionaries based on targer properties +# This is a copy from REFLEX_GENERATE_DICTIONARY from the RootMacros in Root v6.22 +# Copied here to allow creating dictionaries based on target properties #--------------------------------------------------------------------------------------------------- function(PODIO_GENERATE_DICTIONARY dictionary) CMAKE_PARSE_ARGUMENTS(ARG "" "SELECTION" "OPTIONS;DEPENDS" ${ARGN}) @@ -195,7 +195,7 @@ function(PODIO_GENERATE_DATAMODEL datamodel YAML_FILE RETURN_HEADERS RETURN_SOUR endif() endif() - # Make sure that we re run the generation process everytime either the + # Make sure that we re run the generation process every time either the # templates or the yaml file changes. include(${podio_PYTHON_DIR}/templates/CMakeLists.txt) set_property( @@ -211,7 +211,7 @@ function(PODIO_GENERATE_DATAMODEL datamodel YAML_FILE RETURN_HEADERS RETURN_SOUR ) message(STATUS "Creating '${datamodel}' datamodel") - # we need to boostrap the data model, so this has to be executed in the cmake run + # we need to bootstrap the data model, so this has to be executed in the cmake run execute_process( COMMAND ${Python_EXECUTABLE} ${podio_PYTHON_DIR}/podio_class_generator.py ${CLANG_FORMAT_ARG} ${OLD_DESCRIPTION_ARG} ${SCHEMA_EVOLUTION_ARG} ${UPSTREAM_EDM_ARG} ${YAML_FILE} ${ARG_OUTPUT_FOLDER} ${datamodel} ${ARG_IO_BACKEND_HANDLERS} ${LANGUAGE_ARG} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -283,7 +283,7 @@ endfunction() # dict_name Name of the dictionary # CORE_LIB The core datamodel library (e.g. from PODIO_ADD_DATAMODEL_CORE_LIB) # HEADERS The list of all header files generated by PODIO_GENERATE_DATAMODEL -# SELECTION_XML The selection.xml file genertaed by PODIO_GENERATE_DATAMODEL (either an absolute path or relative to OUTPUT_FOLDER) +# SELECTION_XML The selection.xml file generated by PODIO_GENERATE_DATAMODEL (either an absolute path or relative to OUTPUT_FOLDER) # # Parameters: # OUTPUT_FOLDER OPTIONAL: The folder in which the output files have been placed by PODIO_GENERATE_DATAMODEL. Defaults to ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/doc/datamodel_syntax.md b/doc/datamodel_syntax.md index 0de5a4505..b14c85f18 100644 --- a/doc/datamodel_syntax.md +++ b/doc/datamodel_syntax.md @@ -168,7 +168,7 @@ bool valid = energyType.isValid(); // <-- false auto hit = ExampleHit{}; energyType = hit; // assigning a hit to the interface type -energyType.energy(); // <-- get's the energy from the underlying hit +energyType.energy(); // <-- get the energy from the underlying hit auto cluster = ExampleCluster{}; energyType = cluster; // ra-assigning another object is possible diff --git a/doc/templates.md b/doc/templates.md index 25f13089c..7229c71d3 100644 --- a/doc/templates.md +++ b/doc/templates.md @@ -51,7 +51,7 @@ However, it is still necessary to actively fill them from the class generator. If the available information for the new templates is already enough and no further pre-processing is necessary, than they need to be added to `_get_filenames_templates` function in the `ClassGeneratorBaseMixin`. The `prefix` and `postfix` dictionaries define how the template filename will be mapped to the generated files: ``. By default a `.h` and a `.cc` file will be generated, but this can be overridden by adding the template to the `endings` dictionary. -With that in place it is now only neccessary to call `_fill_templates` with the appropriate template name and the pre processed data. +With that in place it is now only necessary to call `_fill_templates` with the appropriate template name and the pre processed data. Note that for most templates this means that they have to be filled for each datatype or component individually. If additional preprocessing is necessary, it will be necessary to also add that to the the language specific generators. diff --git a/env.sh b/env.sh index d5eca5323..014426fb0 100644 --- a/env.sh +++ b/env.sh @@ -3,7 +3,7 @@ # The PODIO environment variable must be set to use this # script if [ -z "$PODIO" ]; then - echo "Please set the PODIO enviroment variable to the install location before sourcing this script." + echo "Please set the PODIO environment variable to the install location before sourcing this script." return fi @@ -18,7 +18,7 @@ if [[ "$unamestr" = 'Linux' ]]; then fi fi elif [[ "$unamestr" = 'Darwin' ]]; then - # This currenty does not work on OS X as DYLD_LIBRARY_PATH is ignored + # This currently does not work on OS X as DYLD_LIBRARY_PATH is ignored # in recent OS X versions if ! echo $DYLD_LIBRARY_PATH | grep -o $PODIO/lib > /dev/null 2>&1; then export DYLD_LIBRARY_PATH=$PODIO/lib:$DYLD_LIBRARY_PATH diff --git a/include/podio/DatamodelRegistry.h b/include/podio/DatamodelRegistry.h index 77f31192b..2d642c118 100644 --- a/include/podio/DatamodelRegistry.h +++ b/include/podio/DatamodelRegistry.h @@ -82,7 +82,7 @@ class DatamodelRegistry { const std::string_view getDatamodelDefinition(std::string_view name) const; /** - * Get the defintion (in JSON format) of the datamodel wth the given index. + * Get the definition (in JSON format) of the datamodel with the given index. * * If no datamodel is found under the given index, an empty datamodel * definition, i.e. an empty JSON object ("{}"), is returned. diff --git a/include/podio/utilities/TypeHelpers.h b/include/podio/utilities/TypeHelpers.h index 7c794230c..41bbf641c 100644 --- a/include/podio/utilities/TypeHelpers.h +++ b/include/podio/utilities/TypeHelpers.h @@ -206,7 +206,7 @@ namespace detail { using hasMutable_t = typename T::mutable_type; /** - * Detector for checking the existance of an object_type type member. Used ot + * Detector for checking the existance of an object_type type member. Used to * determine whether T is (or could be) a podio generated mutable handle. */ template @@ -238,7 +238,7 @@ namespace detail { * Variable template for obtaining the mutable handle type from any podio * generated handle type. * - * If T is alrady a mutable handle, this will return T, if T is a default + * If T is already a mutable handle, this will return T, if T is a default * handle it will return T::mutable_type. */ template diff --git a/python/podio/test_Reader.py b/python/podio/test_Reader.py index 5671244cc..1208feace 100644 --- a/python/podio/test_Reader.py +++ b/python/podio/test_Reader.py @@ -5,9 +5,9 @@ class ReaderTestCaseMixin: """Common unittests for readers. - Inheriting actual test cases have to inhert from this and unittest.TestCase. + Inheriting actual test cases have to inherit from this and unittest.TestCase. All test cases assume that the files are produced with the tests/write_frame.h - functionaltiy. The following members have to be setup and initialized by the + functionality. The following members have to be setup and initialized by the inheriting test cases: - reader: a podio reader """ @@ -75,7 +75,7 @@ class LegacyReaderTestCaseMixin: """Common test cases for the legacy readers python bindings. These tests assume that input files are produced with the write_test.h header - and that inheriting test cases inherit from unittes.TestCase as well. + and that inheriting test cases inherit from unittest.TestCase as well. Additionally they have to have an initialized reader as a member. NOTE: Since the legacy readers also use the BaseReaderMixin, many of the diff --git a/python/podio_gen/cpp_generator.py b/python/podio_gen/cpp_generator.py index 682c18713..079594944 100644 --- a/python/podio_gen/cpp_generator.py +++ b/python/podio_gen/cpp_generator.py @@ -184,7 +184,7 @@ def do_process_datatype(self, name, datatype): return datatype def do_process_interface(self, _, interface): - """Process an interface definition and generate the necesary code""" + """Process an interface definition and generate the necessary code""" interface["include_types"] = [self._build_include(t) for t in interface["Types"]] self._fill_templates("Interface", interface) @@ -556,7 +556,7 @@ def _needs_include(self, classname) -> IncludeFrom: return IncludeFrom.NOWHERE def _build_include(self, member): - """Return the include statment for the passed member.""" + """Return the include statement for the passed member.""" return self._build_include_for_class( member.bare_type, self._needs_include(member.full_type) ) @@ -584,7 +584,7 @@ def _sort_includes(self, includes): i for i in includes if self.upstream_edm.options["includeSubfolder"] in i ) - # Are ther includes that fulfill more than one of the above conditions? Are + # Are their includes that fulfill more than one of the above conditions? Are # there includes that fulfill none? return package_includes + upstream_includes + podio_includes + stl_includes diff --git a/python/podio_gen/generator_base.py b/python/podio_gen/generator_base.py index 0c222514b..e772d1c98 100644 --- a/python/podio_gen/generator_base.py +++ b/python/podio_gen/generator_base.py @@ -40,7 +40,7 @@ class ClassGeneratorBaseMixin: orchestration The base class takes care of initializing the common state that is necessary - for code generation for the different languages. It reads and valiadates the + for code generation for the different languages. It reads and validates the datamodel and sets up the jinja2 environment. Furthermore it provides the functionality for filling templates and it also does the loop over all the components and datatypes in the datamodel offering hooks (see below) to @@ -99,7 +99,7 @@ class ClassGeneratorBaseMixin: post_process(datamodel: dict): do some global post processing for which all components and datatypes need to have been processed already. Gets called with the dictionary that has been created in - pre_proces and filled during the processing. The process + pre_process and filled during the processing. The process components and datatypes are accessible via the "components", "datatypes" and "interfaces" keys respectively. diff --git a/python/podio_gen/generator_utils.py b/python/podio_gen/generator_utils.py index d73afb810..b3dd2ceb0 100644 --- a/python/podio_gen/generator_utils.py +++ b/python/podio_gen/generator_utils.py @@ -278,7 +278,7 @@ def setter_name(self, get_syntax, is_relation=False): return _prefix_name(self.name, "set") def normalize_fw_type(self, fw_type): - """Normalize the fixed width type and make sure to inclde """ + """Normalize the fixed width type and make sure to include """ self.includes.add("#include ") if not fw_type.startswith("std::"): return f"std::{fw_type}" diff --git a/python/podio_gen/podio_config_reader.py b/python/podio_gen/podio_config_reader.py index 77fbd103d..65f569f56 100644 --- a/python/podio_gen/podio_config_reader.py +++ b/python/podio_gen/podio_config_reader.py @@ -35,7 +35,7 @@ class MemberParser: name_str = r"([a-zA-Z_]+\w*)" name_re = re.compile(name_str) - # Units are given in square brakets + # Units are given in square brackets unit_str = r"(?:\[([a-zA-Z_*\/]+\w*)\])?" unit_re = re.compile(unit_str) @@ -326,7 +326,7 @@ def _valid_datatype(rel_type): for relation in one_relations: if not _valid_datatype(relation.full_type): raise DefinitionError( - f"'{classname}' declares an inalid single-relation to '{relation.full_type}'" + f"'{classname}' declares an invalid single-relation to '{relation.full_type}'" ) vector_members = definition.get("VectorMembers", []) @@ -505,7 +505,7 @@ def parse_model(cls, model_dict, package_name, upstream_edm=None): ) except KeyError: # pylint: disable-next=raise-missing-from - raise DefinitionError("Please provide a 'schema_version' in your definintion") + raise DefinitionError("Please provide a 'schema_version' in your definition") except ValueError: # pylint: disable-next=raise-missing-from raise DefinitionError( diff --git a/python/podio_gen/test_ClassDefinitionValidator.py b/python/podio_gen/test_ClassDefinitionValidator.py index cf271e2ef..8e7b2ba05 100644 --- a/python/podio_gen/test_ClassDefinitionValidator.py +++ b/python/podio_gen/test_ClassDefinitionValidator.py @@ -181,7 +181,7 @@ def test_datatype_valid_members(self): ) self._assert_no_exception( DefinitionError, - "{} should allow for re-use of component names if the components are not exposed", + "{} should allow for reuse of component names if the components are not exposed", self.validate, make_dm(self.valid_component, self.valid_datatype, options=self.def_opts), ) diff --git a/python/podio_gen/test_DataModelJSONEncoder.py b/python/podio_gen/test_DataModelJSONEncoder.py index f068b0336..8a3c69ad7 100644 --- a/python/podio_gen/test_DataModelJSONEncoder.py +++ b/python/podio_gen/test_DataModelJSONEncoder.py @@ -67,13 +67,13 @@ def test_encode_default_vals(self): def test_encode_with_description(self): """Test that encoding definitions that contain a description works""" for mdef in ( - r"int i // an unitialized int", + r"int i // an uninitialized int", r"std::uint32_t ui{42} // an initialized unsigned int", r"std::array fs // a float array", r"std::array tA{1, 2, 3} // an initialized array of namespaced types", r"AType type // a very special type", r"nsp::Type nspT // a namespaced type", r"nsp::Type nspT{with init} // an initialized namespaced type", - r"ArbitratyType arbT{42} // an initialized type", + r"ArbitraryType arbT{42} // an initialized type", ): self.assertEqual(get_member_var_json(mdef), mdef) diff --git a/python/templates/Collection.cc.jinja2 b/python/templates/Collection.cc.jinja2 index 91bdc6d7c..812d32ed8 100644 --- a/python/templates/Collection.cc.jinja2 +++ b/python/templates/Collection.cc.jinja2 @@ -197,7 +197,7 @@ namespace { // {% endif %} #} -// The usual trick with an IIFE and a static variable inside a funtion and then +// The usual trick with an IIFE and a static variable inside a function and then // making sure to call that function during shared library loading bool registerCollection() { const static auto reg = []() { @@ -205,8 +205,8 @@ bool registerCollection() { factory.registerCreationFunc("{{ class.full_type }}Collection", {{ package_name }}::meta::schemaVersion, createBuffers); // Make the SchemaEvolution aware of the current version by - // registering a no-op function for this and all preceeding versions - // will be overriden whenever an explicit action is required + // registering a no-op function for this and all preceding versions + // will be overridden whenever an explicit action is required for (unsigned int schemaVersion=1; schemaVersion< {{ package_name }}::meta::schemaVersion+1; ++schemaVersion) { podio::SchemaEvolution::mutInstance().registerEvolutionFunc( "{{ class.full_type }}Collection", diff --git a/python/templates/CollectionData.h.jinja2 b/python/templates/CollectionData.h.jinja2 index 039fd1f4a..5c7eb690e 100644 --- a/python/templates/CollectionData.h.jinja2 +++ b/python/templates/CollectionData.h.jinja2 @@ -60,7 +60,7 @@ public: {{ class_type }}& operator=({{ class_type }}&& other) = default; /** - * Deconstructor + * Destructor */ ~{{ class_type }}() = default; diff --git a/python/templates/Interface.h.jinja2 b/python/templates/Interface.h.jinja2 index f46dbec6e..1adab38de 100644 --- a/python/templates/Interface.h.jinja2 +++ b/python/templates/Interface.h.jinja2 @@ -24,7 +24,7 @@ class {{ class.bare_type }} { /// type alias containing all the types this interface should work for. using InterfacedTypes = std::tuple<{{ Types | join(", ")}}>; - /// type alias containing all the mutable types that can be used to initalize + /// type alias containing all the mutable types that can be used to initialize /// this interface using InterfacedMutableTypes = podio::detail::TupleOfMutableTypes; diff --git a/tools/podio-ttree-to-rntuple b/tools/podio-ttree-to-rntuple index 2e32601d1..33d703479 100755 --- a/tools/podio-ttree-to-rntuple +++ b/tools/podio-ttree-to-rntuple @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -"""podio-ttree-to-rntuple tool to create an rntuple file from a ttree file or viceversa""" +"""podio-ttree-to-rntuple tool to create an rntuple file from a ttree file or vice-versa""" import argparse import podio.root_io parser = argparse.ArgumentParser( description="podio-ttree-to-rntuple tool to create" - "an rntuple file from a ttree file or viceversa" + "an rntuple file from a ttree file or vice-versa" ) parser.add_argument("input_file", help="input file") parser.add_argument("output_file", help="output file")