Hard coded MXG in MMS gridfile generator made flexible modified: mms.py#280
Hard coded MXG in MMS gridfile generator made flexible modified: mms.py#280ZedThree merged 3 commits intoboutproject:masterfrom JensMadsen:adding_mms_flex
Conversation
When writing grid files for MMS use MXG=2 was hard coded. MXG is now an input parameters with default value 2.
dschwoerer
left a comment
There was a problem hiding this comment.
In my opinion omitting those two lines makes the code more readable.
tools/pylib/boutdata/mms.py
Outdated
| """ | ||
|
|
||
| MXG = 2 | ||
| MXG = MXG |
There was a problem hiding this comment.
I guess this line can be removed?
tools/pylib/boutdata/mms.py
Outdated
| """ | ||
|
|
||
| MXG = 2 | ||
| MXG = MXG |
There was a problem hiding this comment.
yes of course. Sorry. I am not that familiar with the fork-branch-pull_request workflow.... Am I supposed to make make the changes and make a new pull request ?
There was a problem hiding this comment.
You can make the changes and push to the same branch (JensMadsen/adding_mms_flex) and it will automatically be added to this pull request.
There was a problem hiding this comment.
If you make the changes and push them, the pull request will automatically be updated.
There was a problem hiding this comment.
Thanks. I do that.
....
By the way. I was changing a minor thing in manual/tex_files/coordinates.tex as well, but in another branch. What is the best way to do this? two different pull request because the changes are not related or just in one pull request because the changes are tiny?
tools/pylib/boutdata/mms.py
Outdated
|
|
||
|
|
||
| def write(self, nx, ny, output): | ||
| def write(self, nx, ny, MXG = 2, output): |
There was a problem hiding this comment.
Can you change the def to this (likewise on L510):
def write(self, nx, ny, output, MXG=2):
Arguments with defaults should go at the end, preferably. Also, there shouldn't be spaces around the equals in the argument definition.
|
Two separate pull requests are fine On Tue, 4 Oct 2016, 14:45 Jens Madsen, notifications@github.com wrote:
|
modified: mms.py removed unnecessary MXG = MXG. MXG argument which has a default value now comes after arguments without default values.
ZedThree
left a comment
There was a problem hiding this comment.
Please could you also add output/filename and MXG to the docstrings? :)
Added descriptions of 'output' and 'MXG' parameters to the docstrings of the write member function of the classes 'SimpleTokamak'. 'ShapedTokamak'.
|
docstring updated |
When writing grid files for MMS use MXG=2 was hard coded. MXG is now an input parameters with default value 2.