Skip to content

Resolve five undefined names found by flake8#112

Merged
AetherUnbound merged 4 commits into
CellProfiler:masterfrom
cclauss:patch-1
Sep 26, 2018
Merged

Resolve five undefined names found by flake8#112
AetherUnbound merged 4 commits into
CellProfiler:masterfrom
cclauss:patch-1

Conversation

@cclauss

@cclauss cclauss commented Sep 25, 2018

Copy link
Copy Markdown
Contributor

Fixes #111. flake8 testing of https://github.com/CellProfiler/python-bioformats on Python 2.7.14

NS_SPW is probably related to https://www.openmicroscopy.org/Schemas/SPW/2015-01/SPW.xsd

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./bioformats/__init__.py:98:5: F821 undefined name 'J'
    J.kill_vm()
    ^
./bioformats/formatreader.py:751:59: F821 undefined name 'path'
                    "The file, \"%s\", does not exist." % path,
                                                          ^
./bioformats/formatreader.py:752:21: F821 undefined name 'path'
                    path)
                    ^
./bioformats/omexml.py:1164:39: F821 undefined name 'NS_SPW'
            make_text_node(self.node, NS_SPW, "Description", test)
                                      ^
./bioformats/omexml.py:1164:62: F821 undefined name 'test'
            make_text_node(self.node, NS_SPW, "Description", test)
                                                             ^
5     F821 undefined name 'J'
5

cclauss added 3 commits September 25, 2018 18:09
[flake8](http://flake8.pycqa.org) testing of https://github.com/CellProfiler/python-bioformats on Python 2.7.14

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./bioformats/__init__.py:98:5: F821 undefined name 'J'
    J.kill_vm()
    ^
./bioformats/formatreader.py:751:59: F821 undefined name 'path'
                    "The file, \"%s\", does not exist." % path,
                                                          ^
./bioformats/formatreader.py:752:21: F821 undefined name 'path'
                    path)
                    ^
./bioformats/omexml.py:1164:39: F821 undefined name 'NS_SPW'
            make_text_node(self.node, NS_SPW, "Description", test)
                                      ^
./bioformats/omexml.py:1164:62: F821 undefined name 'test'
            make_text_node(self.node, NS_SPW, "Description", test)
                                                             ^
5     F821 undefined name 'J'
5
```
__path__ is an _undefined name_ in the context which will probably raise a __NameError__ at runtime instead of the desired Exception.
@cclauss cclauss changed the title Typo: J.kill_vm() --> javabridge.kill_vm() Resolve four out of five undefined names found by flake8 Sep 25, 2018

@AetherUnbound AetherUnbound left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome, one small change to fix NS_SPW

Comment thread bioformats/omexml.py Outdated

def set_Description(self, text):
make_text_node(self.node, NS_SPW, "Description", test)
make_text_node(self.node, NS_SPW, "Description", text)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like NS_SPW should be self.ns['spw'] here: 9db7b40#diff-c03896582c54075ff85c7ee8f756ebf6R897

@cclauss cclauss changed the title Resolve four out of five undefined names found by flake8 Resolve five undefined names found by flake8 Sep 26, 2018

@AetherUnbound AetherUnbound left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome! 🎉

@AetherUnbound AetherUnbound merged commit 22f5bcb into CellProfiler:master Sep 26, 2018
@cclauss cclauss deleted the patch-1 branch September 26, 2018 20:51
toloudis added a commit to AllenCellModeling/aicsimageio that referenced this pull request Oct 31, 2019
bonus fix for set_Description from CellProfiler/python-bioformats#112
toloudis added a commit to AllenCellModeling/aicsimageio that referenced this pull request Oct 31, 2019
* add get_physical_pixel_size to czi and ome tiff readers

* bonus fix for set_Description from CellProfiler/python-bioformats#112

* use tuple instead of list
janeknowsbest77 added a commit to janeknowsbest77/aicsimageio that referenced this pull request Jul 25, 2024
* add get_physical_pixel_size to czi and ome tiff readers

* bonus fix for set_Description from CellProfiler/python-bioformats#112

* use tuple instead of list
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.

2 participants