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

Fix weblogo weblogolib.SymbolColor/ColorGroup import #142

Merged
merged 1 commit into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Use of bumpversion to sync version across files
- Add MDAnalysis as a mandatory module
- Add matplotlib as a mandatory module
- Fix weblogo weblogolib.SymbolColor/ColorGroup import

**1.3.1**
- remove pbxplore import from setup.py and add version number
Expand Down
15 changes: 8 additions & 7 deletions pbxplore/analysis/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@

try:
import weblogolib
# Weblogo compatibility
# With version < 3.5, the color class is 'ColorGroup'. In version >= 3.5,
# it is 'SymbolColor'. Here, we change to always have 'ColorGroup'.
try:
ColorGroup = weblogolib.SymbolColor
except NameError:
ColorGroup = weblogolib.ColorGroup
except ImportError:
IS_WEBLOGO = False
else:
Expand All @@ -35,13 +42,7 @@
except NameError:
pass

# Weblogo compatibility
# With version < 3.5, the color class is 'ColorGroup'. In version >= 3.5,
# it is 'SymbolColor'. Here, we change to always have 'ColorGroup'.
try:
ColorGroup = weblogolib.SymbolColor
except NameError:
ColorGroup = weblogolib.ColorGroup



# Create the __all__ keyword according to the conditional imports
Expand Down