-
Notifications
You must be signed in to change notification settings - Fork 29
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
Flake8 fixes pt3 #126
Closed
Closed
Flake8 fixes pt3 #126
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f24f3df
fix line length
cadenmyers13 69a7864
remove lambda func, import, and fix line length
cadenmyers13 62252fd
remove extra # and fix not in condition
cadenmyers13 8c26405
ambigious letter
cadenmyers13 a5f2760
extra #s
cadenmyers13 60b7f86
fix bare except
cadenmyers13 f95cbfc
fix ambigious l
cadenmyers13 4680567
imports to the top
cadenmyers13 ee16395
Change copyright to trigger build
sbillinge 300a567
remove comment on txtbg var
cadenmyers13 efd8ef2
remove nested sortkey functions
cadenmyers13 f81b678
copyright edits
cadenmyers13 83435e3
update copyright
cadenmyers13 821e2fa
revert copyright
cadenmyers13 0260da4
reverting copyright
cadenmyers13 da3ba3b
reverting back to original copyright
cadenmyers13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
|
||
import os.path | ||
import re | ||
import sys | ||
|
||
import wx | ||
|
||
|
@@ -41,7 +40,9 @@ def __init__(self, *args, **kwds): | |
self.instructionsLabel = wx.StaticText( | ||
self, | ||
wx.ID_ANY, | ||
"Select a fit from the tree on the left then add datasets and assign\ntemperatues below. If you have not set up a fit to be the template\nfor the series, hit cancel and rerun this macro once a fit has been\ncreated.", | ||
"Select a fit from the tree on the left then add datasets and assign\ntemperatues below. " | ||
+ "If you have not set up a fit to be the template\nfor the series, hit cancel and rerun this " | ||
+ "macro once a fit has been\ncreated.", | ||
) | ||
self.instructionsLabel.SetFont( | ||
wx.Font( | ||
|
@@ -201,7 +202,14 @@ def onAdd(self, event): # wxGlade: TemperatureSeriesPanel.<event_handler> | |
if not dir: | ||
dir = self.mainFrame.workpath | ||
|
||
matchstring = "PDF data files (*.gr)|*.gr|PDF fit files (*.fgr)|*.fgr|PDF fit files (*.fit)|*.fit|PDF calculation files (*.cgr)|*.cgr|PDF calculation files (*.calc)|*.calc|All Files|*" | ||
matchstring = ( | ||
"PDF data files (*.gr)|*.gr|" | ||
"PDF fit files (*.fgr)|*.fgr|" | ||
"PDF fit files (*.fit)|*.fit|" | ||
"PDF calculation files (*.cgr)|*.cgr|" | ||
"PDF calculation files (*.calc)|*.calc|" | ||
"All Files|*" | ||
) | ||
d = wx.FileDialog( | ||
None, | ||
"Choose files", | ||
|
@@ -293,13 +301,19 @@ def onColClick(self, event): # wxGlade: TemperatureSeriesPanel.<event_handler> | |
column = event.GetColumn() | ||
# sort by temperature | ||
if column == 0: | ||
sortkey = lambda tf: float(tf[0]) | ||
|
||
def sortkey(tf): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Define the function elsewhere then use it here |
||
return float(tf[0]) | ||
|
||
# sort by filename with numerical comparison of digits | ||
elif column == 1: | ||
filenames = [f for t, f in self.datasets] | ||
numericStringSort(filenames) | ||
order = dict(zip(filenames, range(len(filenames)))) | ||
sortkey = lambda tf: order[tf[1]] | ||
|
||
def sortkey(tf): | ||
return order[tf[1]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
|
||
# ignore unhandled columns | ||
else: | ||
return | ||
|
@@ -308,7 +322,7 @@ def onColClick(self, event): # wxGlade: TemperatureSeriesPanel.<event_handler> | |
self.fillList() | ||
return | ||
|
||
## Utility functions | ||
# Utility functions | ||
def fillList(self): | ||
"""Fill the list with the datasets.""" | ||
self.listCtrlFiles.DeleteAllItems() | ||
|
@@ -325,7 +339,7 @@ def fillList(self): | |
self.listCtrlFiles.SetItem(index, 1, shortname) | ||
return | ||
|
||
## Needed by mainframe | ||
# Needed by mainframe | ||
def treeSelectionUpdate(self, node): | ||
"""Set the current fit when the tree selection changes.""" | ||
nodetype = self.treeCtrlMain.GetNodeType(node) | ||
|
@@ -334,7 +348,7 @@ def treeSelectionUpdate(self, node): | |
self.refresh() | ||
return | ||
|
||
## Required by PDFPanel | ||
# Required by PDFPanel | ||
def refresh(self): | ||
"""Block out OK button if there is no fit. | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will change behavior. If flake8 is complaining about txtbg not being used, just remove the
txtbg =
from the beginning of the line.