Skip to content
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

Introduce SharedTemporaryFile (bis) #769

Merged
merged 11 commits into from Dec 2, 2020

Conversation

guyer
Copy link
Member

@guyer guyer commented Dec 1, 2020

Create a temporary file shared by all MPI ranks

(Previous attempt #767 got broken)

@wd15
Copy link
Contributor

wd15 commented Dec 1, 2020

Add a test maybe? Also add to linter?

@wd15
Copy link
Contributor

wd15 commented Dec 1, 2020

Works for me and documentation looks good

Copy link
Contributor

@tkphd tkphd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice docstrings! 👍

@guyer
Copy link
Member Author

guyer commented Dec 1, 2020

black trashes the formatting recommended buy PEP8 and Donald-Frigging-Knuth, and then pylint complains about it.

E.g, black --target-version py27 --fast fipy/tools/sharedtempfile.py changes

def SharedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
                        newline=None, suffix="", prefix=template,
                        dir=None, delete=True, communicator=parallelComm):

to

def SharedTemporaryFile(
    mode="w+b",
    buffering=-1,
    encoding=None,
    newline=None,
    suffix="",
    prefix=template,
    dir=None,
    delete=True,
    communicator=parallelComm,
):

which leads to pylint spewing:

fipy/tools/sharedtempfile.py:23:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        mode="w+b",
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:24:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        buffering=-1,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:25:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        encoding=None,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:26:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        newline=None,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:27:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        suffix="",
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:28:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        prefix=template,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:29:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        dir=None,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:30:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        delete=True,
        ^   | (bad-continuation)
fipy/tools/sharedtempfile.py:31:0: C0330: Wrong hanging indentation before block (add 4 spaces).
        communicator=parallelComm,
        ^   | (bad-continuation)

The hell with linting.

@guyer guyer requested review from wd15 and tkphd December 1, 2020 21:46
@guyer
Copy link
Member Author

guyer commented Dec 1, 2020

@wd15 @tkphd I've added a test and added (and then deleted) linting. Please recheck.

@guyer guyer merged commit 4b64b6e into usnistgov:master Dec 2, 2020
@guyer guyer deleted the SharedTemporaryFile branch December 2, 2020 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants