From a30574fdff95a10eea97c96cb4b62fb32d5f3386 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sat, 13 Mar 2021 18:56:36 -0500 Subject: [PATCH] Squashed 'wrap/' changes from 91f3835a8..aae9b4605 aae9b4605 Merge pull request #40 from borglab/fix/instantiation-capital dc8c67843 fix template instantiation capitalization git-subtree-dir: wrap git-subtree-split: aae9b4605b1a95fd0165f8ec3fede1fb7ffcb9c1 --- gtwrap/template_instantiator.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gtwrap/template_instantiator.py b/gtwrap/template_instantiator.py index a55a868a3..fe2caf025 100644 --- a/gtwrap/template_instantiator.py +++ b/gtwrap/template_instantiator.py @@ -124,9 +124,14 @@ def instantiate_name(original_name, instantiations): namespaces, but I find that too verbose. """ inst_name = '' + instantiated_names = [] + for inst in instantiations: + # Ensure the first character of the type is capitalized + name = inst.instantiated_name() + # Using `capitalize` on the complete causes other caps to be lower case + instantiated_names.append(name.replace(name[0], name[0].capitalize())) - return "{}{}".format(original_name, "".join( - [inst.instantiated_name().capitalize() for inst in instantiations])) + return "{}{}".format(original_name, "".join(instantiated_names)) class InstantiatedMethod(parser.Method):