-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish generic code_template
from specific code_generator
#298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Chuck this looks good, I just had some questions about the naming and reorganization. One more general comment, it might help the code readability to re-name the 'no-tests' folder to something that describes the contents, such as 'template-instances'. Unless the testing code requires the that specific folder name to skip over the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve readability, can this file name be changed to code_generator.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure: I'll also add abstract
to make that clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this needed to be moved, since it's used specifically for code generation? It seems a little out of place in the generic /utils directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to separate the code_generation
with the details of code generation for this particular application, from code_template
which is more general, and might eventually be factored out of this repo entirely. The distinction might be most clear looking at the tests.
Perhaps better names would make the distinction more clear, but for now:
code_generation
describes the result, and avoids specifying the implementation. There are different ways you could generate code. For example, you could start from a parse tree instead, but it would still be "code generation"code_template
is describing the implementation. There are other template libraries, and this works a lot like them, but it is particularly adapted to python code with it's differentfill_*
methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks for the explanation, I see what you mean.
@mccalluc I think this is ready to merge, after the file name change we discussed. thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved
code_template
has no logic that only applies to this project.__file__
explicit, since the generic code can be used from different locations.analyses
into this new directory, so all the templates are near each other.before:
after: