Skip to content

Commit 7118861

Browse files
authored
Merge pull request #102 from ODM2/development
Development 0.8.0
2 parents 9f7ff39 + cb5d681 commit 7118861

25 files changed

+277
-220
lines changed

setup/Mac/sdl_setup.packproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548
<key>IFPkgFlagPackageSelection</key>
549549
<integer>0</integer>
550550
<key>Name</key>
551-
<string>SDL_v0.7.0_Beta_Mac_Installer</string>
551+
<string>SDL_v0.8.0_Beta_Mac_Installer</string>
552552
<key>Status</key>
553553
<integer>1</integer>
554554
<key>Type</key>

setup/Windows/sdl_setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define MyAppName "StreamingDataLoader"
55
#define MyAppInstaller "SDL"
66
#define MyWizExeName "SDLLoader"
7-
#define MyAppVersion "v0.7.0-beta"
7+
#define MyAppVersion "v0.8.0-beta"
88
#define MyAppPublisher "ODM2"
99
#define MyAppURL "https://github.com/ODM2/ODM2StreamingDataLoader"
1010

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
run the following commands
2+
23
pyinstaller --onefile src\StreamingDataLoader.py
4+
35
pyinstaller --onefile src\StreamingDataLoaderWizard.py

src/StreamingDataLoader.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,28 @@ def main(arguments):
153153
parser = ArgumentParser(description="StreamingDataLoader")
154154
parser.add_argument('-r', '--restart', action='store_true', help="Read the entire CSV file to ensure that data is correct and accounted for. This option affects performance. While the integrity of the data is checked each time the program executes, it is still recommended to use this option if you have manually modified your data file between executions.")
155155
parser.add_argument('-v', '--verbose', action='store_true', help="Enable more verbose logging in the logfile.")
156-
parser.add_argument('-c', '--config', nargs='+', dest="yamlFile", help="Specify a YAML configuration file in the form of one of these formats:\n1. A single YAML (.yaml) file.\n2. A list of YAML files (.yaml), deliminated by white space.\n3. A directory containing multiple YAML (.yaml) files.", required=True, action="store")
156+
parser.add_argument('-c', '--config', nargs='+', dest="yamlFile", help="Specify a YAML configuration file in the form of one of these formats:\n1. A single YAML (.yaml) file.\n2. A list of YAML files (.yaml), deliminated by white space.\n3. A directory containing multiple YAML (.yaml) files.", required=False, action="store")
157157
parser.add_argument('-f', '--file', dest="csvFile", help="Specify a single CSV data file to target instead of the one listed in the configuration file.", required=False, action="store")
158158
args = parser.parse_args()
159159

160+
160161
correct_path = ""
161-
for path in args.yamlFile:
162-
correct_path += path + " "
162+
163+
164+
165+
if args.yamlFile is not None:
166+
# if args in args.yamlFile:
167+
correct_path = ""
168+
for path in args.yamlFile:
169+
correct_path += path + " "
170+
else:
171+
# os.chdir(os.getcwd())
172+
for filename in os.listdir('.'):
173+
if filename.endswith('.yaml'):
174+
correct_path = os.getcwd()
175+
# correct_path += filename
176+
correct_path = os.path.join(correct_path, filename)
177+
break
163178

164179
args.yamlFile = [correct_path.strip()]
165180
start_time = time.time()

src/StreamingDataLoaderWizard.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
# import os
2-
# import sys
31

4-
# import ObjectListView
5-
# import pyodbc
6-
# import pymysql
7-
# import sqlite3
8-
# sys.path.insert(0,os.path.dirname(os.path.dirname(__file__)))
9-
# from src.wizard.controller.frmMain import MainController
10-
# import wx
11-
# if __name__ == '__main__':
12-
# app = wx.App()
13-
# frame = MainController(None)
14-
# frame.CenterOnScreen()
15-
# frame.Show()
16-
# app.MainLoop()
172

183
import os
194
import sys

src/controllers/Database.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ def createConnection(self, Credentials):
3434
print Credentials.host
3535
print Credentials.db_name
3636
print Credentials.uid
37-
print Credentials.pwd
37+
# print Credentials.pwd
3838

3939
self.session_factory = \
4040
dbconnection.createConnection(Credentials.engine, Credentials.host,
4141
Credentials.db_name,
4242
Credentials.uid,
4343
Credentials.pwd, 2.0)
4444
if not self.session_factory:
45-
logger.error("Unable to connect to database with host='%s', database='%s', user='%s', pwd='%s'." % (Credentials.host, Credentials.db_name, Credentials.uid, Credentials.pwd))
45+
message = "Unable to connect to database with host='%s', database='%s', user='%s', pwd='%s'." % (Credentials.host, Credentials.db_name, Credentials.uid, Credentials.pwd)
46+
47+
logger.error(message)
48+
print message
4649
return False
4750

4851
return True

src/controllers/Mapper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,8 @@ def _buildTables(self):
197197
# SDL Test Data is just for our testing purposes.
198198
df['QualityCodeCV'] = 'None'
199199
# df['QualityCodeCV'] = 'SDL Test Data'
200-
# TODO add unknown to database.
201-
#df['CensorCodeCV'] = 'Unknown'
202-
df['CensorCodeCV'] = 'Non-detect'
200+
201+
df['CensorCodeCV'] = 'Not censored'
203202
df['ResultID'] = series['ResultID']
204203
df['ValueDateTimeUTCOffset'] = self.mapping['Settings']['UTCOffset']
205204

src/meta/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
app_name = "Streaming Data Loader"
2-
version = "0.7.0_Beta"
2+
version = "0.8.0_Beta"
33
copyright = "Copyright (c) 2013 - 2015, Utah State University. All rights reserved."
44
description = "Streaming Data Loader a program for streaming continuous sensor data into an instance of the Observations Data Model (ODM)"
55

src/test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Configuration file
2+
## Last modified: 2017-07-11 13:39
3+
---
4+
test:
5+
Database:
6+
Address: localhost
7+
DatabaseName: odm2
8+
Engine: mysql
9+
Password: bobrules
10+
UserName: Bob
11+
Mappings:
12+
RelativeHumidity-%:
13+
CalculateAggInterval: 'false'
14+
IntendedTimeSpacing: 0
15+
IntendedTimeSpacingUnitID: 136
16+
LastByteRead: '127003'
17+
ResultID: 22293
18+
Schedule:
19+
Beginning: 01/01/2014 12:00:00 AM
20+
Frequency: Hour
21+
LastUpdate: '2017-07-11 13:39:41'
22+
Time: 1
23+
Settings:
24+
DataRowPosition: 21
25+
DateTimeColumnName: DateTime
26+
Delimiter: ','
27+
FileLocation: C:\Sites\ODM2StreamingDataLoader\ODM2StreamingDataLoader\tests\test_handlers\test_csvHandler\csvFiles\Treeline_HrlySummary_2014.csv
28+
FillGaps: 'false'
29+
HeaderRowPosition: 20
30+
UTCOffset: 0

src/wizard/controller/WizardDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def addButtons(self):
6262
self.btnNext.Bind(wx.EVT_BUTTON, self.onFinish)
6363
self.btnPrev.Bind(wx.EVT_BUTTON, self.onPrev)
6464

65-
def addPage(self, pnl):
66-
newPnl = pnl(self, self.existingResult)
65+
def addPage(self, pnl, **kwargs):
66+
newPnl = pnl(self, existing_result= self.existingResult, **kwargs)
6767
newPnl.Hide()
6868
self.pnlList.append(newPnl)
6969
self.pnlSizer.Add(newPnl, 1, wx.ALL|wx.EXPAND, 5)

0 commit comments

Comments
 (0)