Skip to content

Commit

Permalink
Made changes to correct failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ananya2003Gupta committed Sep 1, 2023
1 parent 3804767 commit 84c01e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/podio/test_MemberParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_parse_valid(self): # pylint: disable=too-many-statements
self.assertEqual(parsed.description, r'with a top level type')
self.assertTrue(not parsed.is_builtin_array)
self.assertEqual(parsed.array_type, r'::GlobalType')
self.assertEqual(parsed.julia_type, r'MVector{1, Main.GlobalTypeStruct}')
self.assertEqual(parsed.julia_type, r'MVector{1, GlobalTypeStruct}')

parsed = parser.parse(r'std::array<std::int16_t, 42> fixedWidthArray // a fixed width type array')
self.assertEqual(parsed.full_type, r'std::array<std::int16_t, 42>')
Expand Down
7 changes: 5 additions & 2 deletions python/podio_class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def __init__(self, yamlfile, install_dir, package_name, io_handlers, verbose, dr
self.any_changes = False

def _process_parent_module(self, datamodel):
"""Process parent module of julia that contains constructor definitions
of components and datatypes"""
self._fill_templates("ParentModule", datamodel)

def process(self):
Expand Down Expand Up @@ -259,7 +261,7 @@ def _process_component(self, name, component):
includes.update(component.get("ExtraCode", {}).get("includes", "").split('\n'))

component['includes'] = self._sort_includes(includes)
component['includes_jl'] = {'struct': includes_jl}
component['includes_jl'] = {'struct': sorted(includes_jl)}
component['class'] = DataType(name)

self._fill_templates('Component', component)
Expand Down Expand Up @@ -289,6 +291,7 @@ def _preprocess_for_julia(self, datatype):
if not member.is_builtin:
includes_jl_struct.add(self._build_julia_include(member))
datatype['includes_jl']['struct'].update((includes_jl_struct))
sorted(datatype['includes_jl']['struct'])

@staticmethod
def _get_julia_params(datatype):
Expand Down Expand Up @@ -431,7 +434,7 @@ def _preprocess_datatype(self, name, definition):
data['class'] = DataType(name)
data['includes_data'] = self._get_member_includes(definition["Members"])
data['includes_jl'] = {'struct': self._get_member_includes(definition["Members"], julia=True)}
data['params_jl'] = self._get_julia_params(data)
data['params_jl'] = sorted(self._get_julia_params(data))
self._preprocess_for_class(data)
self._preprocess_for_obj(data)
self._preprocess_for_collection(data)
Expand Down
2 changes: 0 additions & 2 deletions python/templates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ set(PODIO_TEMPLATES
${CMAKE_CURRENT_LIST_DIR}/macros/sioblocks.jinja2
${CMAKE_CURRENT_LIST_DIR}/macros/utils.jinja2

${CMAKE_CURRENT_LIST_DIR}/JuliaCollection.jl.jinja2
${CMAKE_CURRENT_LIST_DIR}/Constructor.jl.jinja2
${CMAKE_CURRENT_LIST_DIR}/MutableStruct.jl.jinja2
${CMAKE_CURRENT_LIST_DIR}/ParentModule.jl.jinja2
)

0 comments on commit 84c01e9

Please sign in to comment.