Skip to content

add Project.__enter__ method#18

Merged
Chilipp merged 1 commit intomasterfrom
project-enter
Apr 7, 2020
Merged

add Project.__enter__ method#18
Chilipp merged 1 commit intomasterfrom
project-enter

Conversation

@Chilipp
Copy link
Member

@Chilipp Chilipp commented Apr 7, 2020

this PR adds a Project.__enter__ method to allow usage in a with statement.

This makes the following possible:

with psy.plot.mapplot('file.nc') as sp:
      sp.export('output.png')

sp will be closed automatically.

  • Tests added (for all bug fixes or enhancements)
  • Tests passed (for all non-documentation changes)
  • Fully documented, including CHANGELOG.rst for all changes

this commit adds a Project.__enter__method to allow usage in a with statement.
@Chilipp Chilipp merged commit 122f3a8 into master Apr 7, 2020
@Chilipp Chilipp deleted the project-enter branch April 7, 2020 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant