Skip to content

Commit 69af6cc

Browse files
author
stephanie
committed
fix typo in variable
1 parent fb9d04e commit 69af6cc

File tree

4 files changed

+62
-64
lines changed

4 files changed

+62
-64
lines changed

odmtools/controller/frmCreateVariable.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ def getVariable(self):
6565

6666
def all_fields_full(self):
6767
return (self.cbVarName.GetValue() is not None) and \
68-
(self.txtVarCode.GetValue() <> '') and \
68+
(self.txtVarCode.GetValue() != '') and \
6969
(self.cbVarUnits.GetValue() is not None)and \
7070
(self.cbTSUnits.GetValue() is not None) and \
7171
(self.cbSampleMedium.GetValue() is not None) and \
7272
(self.cbSpeciation.GetValue() is not None) and \
7373
(self.cbValueType.GetValue() is not None) and \
7474
(self.cbDataType.GetValue() is not None) and \
75-
(self.txtNoDV.GetValue() <> '') and \
75+
(self.txtNoDV.GetValue() != '') and \
7676
(self.cbGenCat.GetValue() is not None) and \
77-
(self.txtTSValue.GetValue() <> '')
77+
(self.txtTSValue.GetValue() != '')
7878

7979

8080
def OnBtnCreateButton(self, event):
@@ -89,24 +89,24 @@ def OnBtnCreateButton(self, event):
8989
def createVariable(self):
9090
v = Variable()
9191

92-
v.code = self.txtVarCode.GetValue() if self.txtVarCode.GetValue() <> u'' else None
93-
v.contact_name = self.cbVarName.GetValue() if self.cbVarName.GetValue() <> u'' else None
94-
v.speciation = self.cbSpeciation.GetValue() if self.cbSpeciation.GetValue() <> u'' else None
92+
v.code = self.txtVarCode.GetValue() if self.txtVarCode.GetValue() != u'' else None
93+
v.name = self.cbVarName.GetValue() if self.cbVarName.GetValue() != u'' else None
94+
v.speciation = self.cbSpeciation.GetValue() if self.cbSpeciation.GetValue() != u'' else None
9595

9696
v.variable_unit = self.series_service.get_unit_by_name( self.cbVarUnits.GetValue())
9797
v.variable_unit_id = v.variable_unit.id
9898

99-
v.sample_medium = self.cbSampleMedium.GetValue() if self.cbSampleMedium.GetValue() <> u'' else None
100-
v.value_type = self.cbValueType.GetValue() if self.cbValueType.GetValue() <> u'' else None
101-
v.is_regular = self.cbIsRegular.GetValue() if self.cbIsRegular.GetValue() <> u'' else None
102-
v.time_support = self.txtTSValue.GetValue() if self.txtTSValue.GetValue() <> u'' else None
99+
v.sample_medium = self.cbSampleMedium.GetValue() if self.cbSampleMedium.GetValue() != u'' else None
100+
v.value_type = self.cbValueType.GetValue() if self.cbValueType.GetValue() != u'' else None
101+
v.is_regular = self.cbIsRegular.GetValue() if self.cbIsRegular.GetValue() != u'' else None
102+
v.time_support = self.txtTSValue.GetValue() if self.txtTSValue.GetValue() != u'' else None
103103

104104
v.time_unit = self.series_service.get_unit_by_name(self.cbTSUnits.GetValue())
105105
v.time_unit_id = v.time_unit.id
106106

107-
v.data_type = self.cbDataType.GetValue() if self.cbDataType.GetValue() <> u'' else None
108-
v.general_category = self.cbGenCat.GetValue() if self.cbGenCat.GetValue() <> u'' else None
109-
v.no_data_value = self.txtNoDV.GetValue() if self.txtNoDV.GetValue() <> u'' else None
107+
v.data_type = self.cbDataType.GetValue() if self.cbDataType.GetValue() != u'' else None
108+
v.general_category = self.cbGenCat.GetValue() if self.cbGenCat.GetValue() != u'' else None
109+
v.no_data_value = self.txtNoDV.GetValue() if self.txtNoDV.GetValue() != u'' else None
110110
return v
111111

112112
def OnBtnCancelButton(self, event):

odmtools/controller/frmSource.py

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,62 @@
44
from odmtools.view.clsSource import clsSource
55
from odmtools.odmdata import Source
66

7+
78
# Implementing clsSource
89
class frmCreateSource(clsSource):
9-
def __init__( self, parent, service_man, prev_src):
10-
clsSource.__init__(self, parent)
11-
self.service_man = service_man
12-
self.prev = prev_src
13-
self.source=None
14-
self.series_service = self.service_man.get_series_service()
15-
16-
17-
def getSource(self):
18-
return self.source
19-
10+
def __init__(self, parent, service_man, prev_src):
11+
clsSource.__init__(self, parent)
12+
self.service_man = service_man
13+
self.prev = prev_src
14+
self.source = None
15+
self.series_service = self.service_man.get_series_service()
2016

21-
# Handlers for dlgCreateSource events.
22-
def onOkClick(self, event):
23-
self.source = self.createSource()
17+
def getSource(self):
18+
return self.source
2419

25-
if self.all_fields_full():
26-
self.EndModal(wx.ID_OK)
27-
else:
28-
wx.MessageDialog(None, "Source was not created, A Value is missing", " ", wx.OK).ShowModal()
20+
# Handlers for dlgCreateSource events.
21+
def onOkClick(self, event):
22+
self.source = self.createSource()
2923

30-
def all_fields_full(self):
31-
return (self.txtOrg.GetValue() is not None) and \
32-
(self.txtDescrip.GetValue() <> '') and \
33-
(self.txtLink.GetValue() is not None) and \
34-
(self.txtName.GetValue() is not None) and \
35-
(self.txtPhone.GetValue() is not None) and \
36-
(self.txtEmail.GetValue() is not None) and \
37-
(self.txtAddress.GetValue() is not None) and \
38-
(self.txtCity.GetValue() is not None) and \
39-
(self.txtState.GetValue() <> '') and \
40-
(self.txtZip.GetValue() is not None) and \
41-
(self.txtCitation.GetValue() <> '')
24+
if self.all_fields_full():
25+
self.EndModal(wx.ID_OK)
26+
else:
27+
wx.MessageDialog(None, "Source was not created, A Value is missing", " ", wx.OK).ShowModal()
4228

43-
def createSource(self):
44-
s = Source()
29+
def all_fields_full(self):
30+
return (self.txtOrg.GetValue() is not None) and \
31+
(self.txtDescrip.GetValue() != '') and \
32+
(self.txtLink.GetValue() is not None) and \
33+
(self.txtName.GetValue() is not None) and \
34+
(self.txtPhone.GetValue() is not None) and \
35+
(self.txtEmail.GetValue() is not None) and \
36+
(self.txtAddress.GetValue() is not None) and \
37+
(self.txtCity.GetValue() is not None) and \
38+
(self.txtState.GetValue() != '') and \
39+
(self.txtZip.GetValue() is not None) and \
40+
(self.txtCitation.GetValue() != '')
4541

46-
s.organization = self.txtOrg.GetValue() if self.txtOrg.GetValue() <> u'' else None
47-
s.description = self.txtDescrip.GetValue() if self.txtDescrip.GetValue() <> u'' else None
48-
s.link = self.txtLink.GetValue() if self.txtLink.GetValue() <> u'' else None
42+
def createSource(self):
43+
s = Source()
4944

50-
s.contact_name = self.txtName.GetValue() if self.txtName.GetValue() <> u'' else None
51-
s.phone = self.txtPhone.GetValue() if self.txtPhone.GetValue() <> u'' else None
52-
s.email = self.txtEmail.GetValue() if self.txtEmail.GetValue() <> u'' else None
45+
s.organization = self.txtOrg.GetValue() if self.txtOrg.GetValue() != u'' else None
46+
s.description = self.txtDescrip.GetValue() if self.txtDescrip.GetValue() != u'' else None
47+
s.link = self.txtLink.GetValue() if self.txtLink.GetValue() != u'' else None
5348

54-
s.address = self.txtAddress.GetValue() if self.txtAddress.GetValue() <> u'' else None
55-
s.city = self.txtCity.GetValue() if self.txtCity.GetValue() <> u'' else None
56-
s.state = self.txtState.GetValue() if self.txtState.GetValue() <> u'' else None
57-
s.zip_code = self.txtZip.GetValue() if self.txtZip.GetValue() <> u'' else None
49+
s.contact_name = self.txtName.GetValue() if self.txtName.GetValue() != u'' else None
50+
s.phone = self.txtPhone.GetValue() if self.txtPhone.GetValue() != u'' else None
51+
s.email = self.txtEmail.GetValue() if self.txtEmail.GetValue() != u'' else None
5852

59-
s.citation = self.txtCitation.GetValue() if self.txtCitation.GetValue() <> u'' else None
60-
# s.metadata_id = self.chMeta.GetValue() if self.chMeta.GetValue() <> u'' else 0
61-
s.iso_metadata_id = 0
62-
return s
53+
s.address = self.txtAddress.GetValue() if self.txtAddress.GetValue() != u'' else None
54+
s.city = self.txtCity.GetValue() if self.txtCity.GetValue() != u'' else None
55+
s.state = self.txtState.GetValue() if self.txtState.GetValue() != u'' else None
56+
s.zip_code = self.txtZip.GetValue() if self.txtZip.GetValue() != u'' else None
6357

58+
s.citation = self.txtCitation.GetValue() if self.txtCitation.GetValue() != u'' else None
59+
# s.metadata_id = self.chMeta.GetValue() if self.chMeta.GetValue() != u'' else 0
60+
s.iso_metadata_id = 0
61+
return s
6462

65-
def onCancelClick(self, event):
66-
# TODO: Implement onCancelClick
67-
self.EndModal(wx.ID_CANCEL)
63+
def onCancelClick(self, event):
64+
# TODO: Implement onCancelClick
65+
self.EndModal(wx.ID_CANCEL)

odmtools/controller/logicPlotOptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def calculateIntervalsOnGroups(self, interval):
483483
data_median = np.median(datavalue)
484484
data_std = math.sqrt(np.var(datavalue))
485485
data_sqrt = math.sqrt(len(interval))
486-
if data_sqrt <> 0:
486+
if data_sqrt != 0:
487487
data_deviation = data_std / data_sqrt
488488
else: data_deviation = 1
489489

odmtools/gui/plotBoxWhisker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _createPlot(self, oneSeries, rows, cols, index):
116116
ax.scatter([range(1, len(med) + 1)], med, marker='s', c="k", s=10)
117117

118118
# bp = onSeries.dataTable.boxplot(
119-
bp = oneSeries.dataTable[oneSeries.dataTable["DataValue"]<>oneSeries.noDataValue].boxplot(column="DataValue", ax=ax, by=oneSeries.BoxWhisker.currinterval.groupby,
119+
bp = oneSeries.dataTable[oneSeries.dataTable["DataValue"]!=oneSeries.noDataValue].boxplot(column="DataValue", ax=ax, by=oneSeries.BoxWhisker.currinterval.groupby,
120120
rot=35, notch=True, sym="-s", conf_intervals=ci, return_type='dict',
121121
grid=False)
122122

0 commit comments

Comments
 (0)