-
Notifications
You must be signed in to change notification settings - Fork 7
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
Consistent use: Multiple occurances - Inconsistent Function Definitions #280
Comments
Needs scoping, but maybe chapter committee:
|
Each committee chair should check the box when they're done. Creating a small pull request for each chapter (or group of chapters if you own more than one) is probably as good a way as any to do this. Make sure that in your pull request, you mention this ticket (#280) without saying "Fixes" to avoid automatically closing it since there will be more than one PR to do this work. Also, if there's nothing to be done in your chapter, just check the box.
@martinruefenacht will add an automated check to look for these empty descriptions with no default description and flag them, causing the check to fail. The chapter committees will need to fix those. |
Currently when the binding tool comes across a parameter with an empty description a default description mapping is looked up. These default descriptions were taken from MPI 3.1:
If none is found then we just leave it as empty with the LIS typing. For empty description parameters we can either introduce a default description for that KIND or we can set the "desc" attribute of that parameter. For the given example "flag" we would set "desc" since it is not a global description. |
@wesbland Does this prohibit empty LIS descriptors? (easy to test for with the default descriptions) The notion of a similar/related function with similar parameters and "inconsistent" descriptions will be difficult to test. It could be done with not so complex to complex methods + a threshold (dicey). But until we have semantic information via semantics-wg we can't do this well unless we label related functions, which I think defeats the purpose. |
Question: in chapter 6, I see this for the definition of
Is it normal to have Thanks. |
This is LaTeX code within a Python string; the double \ is Python's way of escaping a single \ that would otherwise be interpreted as a special character. See, for example, https://www.pitt.edu/~naraehan/python2/tutorial7.html |
Yes, but there are a lot of places with a single |
Just to be clear: I don't care about |
Yeah, ok; following several usages of My best guess is that "\m" is not a recognised Python escape sequence, i.e. Python has no other way to interpret this except as two normal characters, so it is kind and does the sensible thing. Same for "\c" (used for the "\const" command) and others. That is, the correct/intended evaluation of a single \ is an accident. This guess seems to be backed up by this reference page: https://docs.python.org/2.0/ref/strings.html If so, then LaTeX commands like '\annexref{' (used in chap-topol but, fortunately, not in a binding) and '\begin{' (used all over the place but, fortunately, not in bindings) would go wrong. Fortunately, we are reserving use of '\ftype' (and similar commands beginning with f) in bindings to the LaTeX code output by the Python, rather than permitting it/them in the input Python code. Maybe @martinruefenacht will be able to explain (better). If my guess is right, then we should decide between "always escape " and "always escape \ when it matters" as a style rule and implement a make check to enforce consistency. |
@GuillaumeMercier Yes, the "\\" is the correct way of expressing a "\" (not talking about raw strings right now). There is no "\m" character therefore it works either way, but for correctness/consistency we should be using "\\" as you said (PEP8 python style guide requires proper escaping). I thought I had gone through the mpi-binding blocks and did "\" -> "\\". I will write a test for it... (what I should have done at the time) If you are referring to "\" outside the mpi-blocking blocks, that is how it is meant to be, since that is Latex and not Python code. |
I'm only referring to Python code, of course. |
I think that was the idea of what we discussed on the call on Wednesday, yes. You can only have an empty LIS description if there is a default description that will fill the gap. |
@martinruefenacht and @dholmes-epcc-ed-ac-uk : OK, that makes sense (as to why |
@GuillaumeMercier I think I should combine a pass over the document and a test for it in a single PR. Unless you definitely want to do it. |
Not particularly. I prefer your global approach. |
re: string-escape issue, it probably makes more sense (and is easier) to use a raw string:
@dholmes-epcc-ed-ac-uk you are correct that Python's default way of interpreting unrecognized escape sequences is to ignore it; as of Python 3.6 this is deprecated, with the intent of eventually changing this into an error. |
@omor1 Agreed. Either works, but it seems to be causing misunderstandings. I will work on the binding_linter so simply convert all the strings we have to raw-strings. |
Just to be sure: should I convert the |
@GuillaumeMercier No, let's do those changes in a separate pass given this issue/PRs are intended to fix inconsistent descriptions or defaulted (by setting it empty). |
PR mpi-forum/mpi-standard/pull/342 addresses these concerns for the datatype chapter. Nothing needed to be amended in the environment chapter. |
Problem
Some function definitions are missing or have inconsistent (with similar arguments in other functions) descriptions. See, for example, MPI_TESTALL (page 62) description for the flag argument should use the same text as MPI_TESTANY (page 60), except "true if all..."
Suggested Fix
Suggest asking the bindings committee to review
The text was updated successfully, but these errors were encountered: