def defaultProject(self): self.parent.tc = timechange.TimeChange() projectDir = os.path.join(os.path.expanduser('~'), 'timechange', 'default') #self.parent.loadProject(projectDir) t = Thread(target=self.parent.loadProject, args=(projectDir, )) t.start()
def loadProject(self): projectDir = filedialog.askdirectory( initialdir=os.path.expanduser("~")) dirname = os.path.dirname(os.path.realpath(projectDir)) basename = os.path.basename(os.path.realpath(projectDir)) try: self.parent.tc = timechange.TimeChange(project_name=basename, parent_folder=dirname) self.parent.loadProject(projectDir) except: messagebox.showerror( "Error", "%s is an invalid project directory" % projectDir)
def defaultProject(self): try: self.parent.tc = timechange.TimeChange() self.parent.columns = self.parent.tc.get_csv_columns() projectDir = os.path.join(os.path.expanduser('~'), 'timechange', 'default') self.parent.loadProject(projectDir) #Start event loop self.parent.handle_queue() except Exception as e: messagebox.showerror("Project Loading Error", str(e)) # Show error message
CONVERT_CHUNK_SIZE = 64 #Metaparameters for training NUM_EPOCHS = 20 #Seed the random number generator random.seed(413) np.random.seed(413) #Delete the test project from previous iterations (if it exists) try: shutil.rmtree(os.path.join(PROJECT_PARENT, PROJECT_NAME)) except FileNotFoundError as exc: pass #Create a timechange object #Store the timechange profile along with this script time_change = timechange.TimeChange(PROJECT_NAME, PROJECT_PARENT) """ ======================================= Sample data generation ======================================= """ #Generate random data for a specific wave function def random_wave(wave_type, length): #Generate random parameters amplitude = np.random.uniform(SAMPLE_AMPLITUDE_MIN, SAMPLE_AMPLITUDE_MAX) frequency = np.random.uniform(SAMPLE_FREQUENCY_MIN, SAMPLE_FREQUENCY_MAX) shift = np.random.uniform(SAMPLE_SHIFT_MIN, SAMPLE_SHIFT_MAX) #Generate the linear space wave_space = np.linspace(SAMPLE_LEFT_BOUND,
def defaultProject(self): self.parent.tc = timechange.TimeChange() projectDir = os.path.join(os.path.expanduser('~'), 'timechange', 'default') self.parent.loadProject(projectDir)