Skip to content

Commit

Permalink
Fix more typos (#571)
Browse files Browse the repository at this point in the history
* Fix typos in comments

* fix more typos
  • Loading branch information
m-fila authored Mar 19, 2024
1 parent 8ce5945 commit 203f763
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spack*
/compile_commands.json
.vscode
/.cache/
.venv

# Generated files
*podio_generated_files.cmake
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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=<type>`` when invoking CMake
if(NOT CMAKE_CONFIGURATION_TYPES)
if(NOT CMAKE_BUILD_TYPE)
Expand Down
4 changes: 2 additions & 2 deletions cmake/podioBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions cmake/podioMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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(
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion doc/datamodel_syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<prefix><template-filename><postfix>`.
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.
Expand Down
4 changes: 2 additions & 2 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/podio/DatamodelRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/podio/utilities/TypeHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
Expand Down Expand Up @@ -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 <typename T>
Expand Down
6 changes: 3 additions & 3 deletions python/podio/test_Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/podio_gen/cpp_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
)
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions python/podio_gen/generator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion python/podio_gen/generator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstdint>"""
"""Normalize the fixed width type and make sure to include <cstdint>"""
self.includes.add("#include <cstdint>")
if not fw_type.startswith("std::"):
return f"std::{fw_type}"
Expand Down
6 changes: 3 additions & 3 deletions python/podio_gen/podio_config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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", [])
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion python/podio_gen/test_ClassDefinitionValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
4 changes: 2 additions & 2 deletions python/podio_gen/test_DataModelJSONEncoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<float, 3> fs // a float array",
r"std::array<nsp::T, 32> 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)
6 changes: 3 additions & 3 deletions python/templates/Collection.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ 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 = []() {
auto& factory = podio::CollectionBufferFactory::mutInstance();
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",
Expand Down
2 changes: 1 addition & 1 deletion python/templates/CollectionData.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public:
{{ class_type }}& operator=({{ class_type }}&& other) = default;

/**
* Deconstructor
* Destructor
*/
~{{ class_type }}() = default;

Expand Down
2 changes: 1 addition & 1 deletion python/templates/Interface.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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<InterfacedTypes>;

Expand Down
4 changes: 2 additions & 2 deletions tools/podio-ttree-to-rntuple
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit 203f763

Please sign in to comment.