-
Notifications
You must be signed in to change notification settings - Fork 134
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
Deal with external type bound procedures without local overwrite #677
base: master
Are you sure you want to change the base?
Deal with external type bound procedures without local overwrite #677
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.
This fixes #676, but not very elegantly. Somehow the externalization stuff bleeds into the templates/macros.html, which does not seem very desirable. The logic for external in the progress of the correlate
methods may also be needed elsewhere, and maybe it would be better to overwrite the correlate
functions for the External*
classes.
if hasattr(intObj, "extends"): | ||
if isinstance(intObj.extends, FortranType): | ||
extDict["extends"] = obj2dict(intObj.extends) | ||
else: | ||
extDict["extends"] = intObj.extends |
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 think we want to follow the extends further up, after we first hit an external project, so there isn't really a need for this information in the serialized file.
if isinstance(intObj, str): | ||
return intObj |
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.
Due to the attribs
list for type-bound procedures we need to take care of strings in the recursive serialization.
if hasattr(r, "meta"): | ||
self.max_nesting = max(self.max_nesting, int(r.meta.graph_maxdepth)) | ||
self.max_nodes = max(self.max_nodes, int(r.meta.graph_maxnodes)) | ||
if hasattr(r, "settings"): | ||
self.warn = self.warn or (r.settings.warn) |
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.
The nodes we want to add here, may be from external projects and won't have the meta
and settings
attribute, hence we need to treat this gracefully.
break | ||
if proc.generic: | ||
proc.correlate(project) | ||
if type(proc) is FortranBoundProcedure: |
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.
Only continue correlation and bindings lookup for non-external BoundProcedures.
{%- if not entity.external_url -%} | ||
{%- if entity | meta('deprecated') -%} | ||
<span class="badge bg-danger depwarn">Deprecated</span> | ||
{%- endif -%} |
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.
For external projects we do not know the deprecation status and need to skip this here.
{%- if tb.external_url %} | ||
(external{% if not link_name %}: {{ tb | relurl(page_url) }}{% endif %}) | ||
{%- else %} | ||
{%- if tb.generic or (tb.name != tb.bindings[0].name and tb.name != tb.bindings[0]) %} => {{ tb.bindings | join(", ") }}{% endif %} | ||
{% if tb.binding|length == 1 %}<small>{{ tb.bindings[0].proctype }}</small>{% endif %} | ||
{% endif %} |
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.
If this is an external procedure, we do not have more info on it, point it out, and link to it if not done already.
{{ binding_summary(bind.proto.procedure,proto=True) }} | ||
{% elif bind.proto.obj == 'procedure' %} | ||
{{ binding_summary(bind.proto,proto=True) }} | ||
{% if not tb.external_url %} |
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.
Skip these details for external procedures.
@@ -569,7 +577,9 @@ <h4>Type-Bound Procedures</h4> | |||
{% for tb in dtype.boundprocs %} | |||
<tr> | |||
<td>{{ bound_declaration(tb, link_name=True) }}</td> | |||
<td>{{ tb | meta('summary') | relurl(page_url) }}</td> | |||
{% if not tb.external_url %} |
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.
Skip the summary for external procedures.
directory = Path(directory).absolute() | ||
self.directory = Path(directory).absolute() |
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 have the feeling, that the information on the project directory is already somewhere stored in the Project object, but I somehow could not find it. I am not sure if storing this info in the settings object is the right thing to do. But it appeared natural to store it at this point.
I introduced this to allow for relative local path definitions in the external projects.
See: #676 (comment)
Thanks @haraldkl! Not had chance to go through this properly yet, but it looks good so far! |
An attempt to address #676.