-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Reuse jinja templates and create mixed types class from tem…
…plate (#24) * Create mixedtype_class_template.txt * Initialize and reuse template in build, implement mixed type template * Fix template whitespace
- Loading branch information
1 parent
f32e867
commit 6ed00f0
Showing
7 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,10 @@ classdef {{ class_name }} < openminds.abstract.ControlledTerm | |
{%- endfor %} | ||
] | ||
end | ||
|
||
methods | ||
function obj = {{ class_name }}(varargin) | ||
[email protected](varargin{:}) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
classdef {{ class_name }} < openminds.internal.abstract.LinkedCategory | ||
properties (Constant, Hidden) | ||
ALLOWED_TYPES = [ ... | ||
{%- for full_type_name in allowed_types_list %} | ||
{%- if not loop.last%} | ||
"{{full_type_name}}", ... | ||
{%- else%} | ||
"{{full_type_name}}" ... | ||
{%- endif -%} | ||
|
||
{%- endfor %} | ||
] | ||
IS_SCALAR = {{is_scalar}} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,11 +52,10 @@ classdef {{ class_name }} < {{base_class}} | |
[email protected](varargin{:}) | ||
end | ||
end | ||
|
||
methods (Access = protected) | ||
function str = getDisplayLabel(obj) | ||
{{display_label_method_expression}} | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
classdef Types < openminds.abstract.TypesEnumeration | ||
|
||
enumeration | ||
None('None') | ||
{%- for type in types %} | ||
{{type.name}}("{{type.class_name}}") | ||
{%- endfor %} | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters