def initialize(self):
     if len(self.filename) > 0:
         if os.path.isfile(self.filename):
             self.data = pt_data.load_file(self.filename)
             self.populate_shot_list()
         else:
             QtWidgets.QMessageBox.information(
                 QtWidgets.QWidget(), 'Error Loading Data File',
                 'The data file ({0}) could not be found. Please choose another file'
                 .format(self.filename))
             self.dialog.done(0)
     else:
         QtWidgets.QMessageBox.information(
             QtWidgets.QWidget(), 'Error Loading Data File',
             'No file was specified. Please select a file and try again.')
         self.dialog.done(0)
Example #2
0
import pt_plot
import pt_data

pt = pt_plot.ProTracerPlot()

data = pt_data.load_file('C:\\Users\\ronri\\OneDrive\\Mercyhurst\\DATA 520 - Intro to Programming\\projects\\ideal-enigma\\data\\traj-detail-2017771908.TXT')

shots = []
'''
shots.append({
        'Player Last First': 'Mickelson, Phil',
        'Tournament Name': 'Safeway Open',
        'Round': 1,
        'Hole Number': 5
    })
shots.append({
        'Player Last First': 'Mickelson, Phil',
        'Tournament Name': 'Safeway Open',
        'Round': 2,
        'Hole Number': 5
    })
shots.append({
        'Player Last First': 'Mickelson, Phil',
        'Tournament Name': 'Safeway Open',
        'Round': 3,
        'Hole Number': 5
    })
shots.append({
        'Player Last First': 'Mickelson, Phil',
        'Tournament Name': 'Safeway Open',
        'Round': 4,
import pt_plot
import pt_data

pt = pt_plot.ProTracerPlot()

data = pt_data.load_file(
    'C:\\Users\\ronri\\OneDrive\\Mercyhurst\\DATA 520 - Intro to Programming\\projects\\ideal-enigma\\data\\crappy-golfers.TXT'
)

shots = []
shots.append({
    'Player Last First': 'Spieth, Jordan',
    'Tournament Name': 'AT&T Byron Nelson',
    'Round': 2,
    'Hole Number': 16
})

for shot in shots:
    shot_data = pt_data.get_shot(data, shot["Player Last First"],
                                 shot["Tournament Name"], shot["Round"],
                                 shot["Hole Number"])

    # shot summary
    summary = pt_data.get_shot_summary(shot_data)
    pt.add_plot_data(shot_data, summary)

# pt.plot_2d()
pt.plot_3d(azim=89, title="Jordan Spieth Sucks")