(re.compile(r'__libcalico_version__\s*=\s*".*"'), '__libcalico_version__ = "{libcalico-version}-dev"'), (re.compile(r'__felix_version__\s*=\s*".*"'), '__felix_version__ = "{calico-version}-dev"'), (re.compile(r'__kubernetes_plugin_version__\s*=\s*".*"'), '__kubernetes_plugin_version__ = "{kubernetes-version}"'), (re.compile(r'https://github\.com/projectcalico/calico\-docker/blob/.*/README\.md'), 'https://github.com/projectcalico/calico-docker/blob/{version}/README.md') ] # Load the globally required release data. release_data = utils.load_release_data() # ============== Define the release steps. =============== def start_release(): """ Start the release process, asking user for version information. :return: """ para("Step 1 of 5: Create and push release branch with new versions.") para("Your git repository should be checked out to the correct revision " "that you want to cut a release with. This is usually the HEAD of " "the master branch.") utils.check_or_exit("Are you currently on the correct revision")
def __init__(self, gui_params, params): self.curation_data = utils.load_manual_curation( params['curation_csvpath']) self.males_list = utils.load_male_list(params['male_listpath']) self.induction_dates = utils.load_induction_data( params['induction_csvpath']) self.season_data = utils.load_pond_season_data( params['pond_season_csvpath']) self.early_release = utils.load_release_data( params['early_release_csvpath']) self.late_release = utils.load_release_data( params['late_release_csvpath']) self.duplicate_data = utils.load_duplicate_data( params['duplicate_csvpath']) self.experimenter_data, self.inducer_data = utils.load_experimenter_data( params['experimenter_csvpath']) self.gui_params = gui_params self.params = params self.params.update(self.gui_params) self.auto_save_count = 0 file_list = [] metadata_list = [] print "Reading in image file list" with open(self.params["image_list_filepath"], "rb") as f: line = f.readline().strip() while line: file_list.append(line) line = f.readline().strip() print "Reading in analysis file" self.data = utils.csv_to_df(self.params["input_analysis_file"]) try: saved_data = utils.csv_to_df(self.params["output_analysis_file"]) for row in saved_data.iterrows(): i = np.where(self.data['filebase'] == row[1]['filebase']) for k, v in row[1].iteritems(): self.data.loc[i[0], k] = v except IOError: pass if not hasattr(self.data, 'accepted'): self.data['accepted'] = np.zeros(len(self.data)) self.shape_data = utils.read_shape_long( self.params["input_shape_file"]) try: saved_shape_data = utils.read_shape_long( self.params["output_shape_file"]) fbs = np.unique(saved_shape_data['filebase']) self.shape_data = self.shape_data.drop( self.shape_data[self.shape_data['filebase'].isin(fbs)].index) self.shape_data = self.shape_data.append(saved_shape_data) except IOError: pass try: self.masked_regions = utils.read_masked_regions_long( self.params["masked_regions_output"]) except IOError: self.masked_regions = {} all_clone_list = [] for f in file_list: try: fileparts = f.split("/") clone = utils.dfrow_to_clone( self.data, np.where(self.data.filebase == fileparts[-1])[0][0], self.params) clone.filepath = f all_clone_list.append(clone) except IndexError: print "No entry found in datafile for " + str(f) for i in xrange(len(all_clone_list)): index = (self.shape_data.filebase == all_clone_list[i].filebase) all_clone_list[i].dorsal_edge = np.transpose( np.vstack((np.transpose(self.shape_data.loc[index].x), np.transpose(self.shape_data.loc[index].y)))) all_clone_list[i].q = np.array(self.shape_data.loc[index].q) all_clone_list[i].qi = np.array(self.shape_data.loc[index].qi) idx = self.shape_data.loc[index].checkpoint == 1 all_clone_list[i].checkpoints = all_clone_list[i].dorsal_edge[ idx, :] clone_list = [] for clone in all_clone_list: if len(clone.dorsal_edge) > 0: if not (int(self.params['skip_accepted']) and clone.accepted): clone_list.append(clone) else: print "No shape data found for " + clone.filebase if len(clone_list) == 0: print "Either image list is empty or they have all been 'accepted'" return self.all_clone_list = all_clone_list self.clone_list = clone_list self.curr_idx = 0 self.clone = self.clone_list[self.curr_idx] self.saving = 0 self.fig = plt.figure(figsize=(15, 10)) self.fig.patch.set_facecolor("lightgrey") self.display = self.fig.add_subplot(111) self.display.axis('off') try: self.obj = PointFixer(self.clone, self.display) try: self.obj.masked_regions = self.masked_regions[ self.clone.filebase] self.mask_all_regions() except (AttributeError, KeyError): pass except IOError: try: self.clone.modification_notes += " Image file not found." except TypeError: self.clone.modification_notes = "Image file not found." if self.curr_idx < len(self.clone_list) - 1: self.next_button_press(1) self.obj.clone.modifier = self.gui_params["default_modifier"] self.populate_figure() self.add_checkpoint = False return
(re.compile(r'__libnetwork_plugin_version__\s*=\s*".*"'), '__libnetwork_plugin_version__ = "{libnetwork-version}-dev"'), (re.compile(r'__libcalico_version__\s*=\s*".*"'), '__libcalico_version__ = "{libcalico-version}-dev"'), (re.compile(r'__felix_version__\s*=\s*".*"'), '__felix_version__ = "{calico-version}-dev"'), (re.compile(r'__kubernetes_plugin_version__\s*=\s*".*"'), '__kubernetes_plugin_version__ = "{kubernetes-version}"'), (re.compile( r'https://github\.com/projectcalico/calico\-docker/blob/.*/README\.md' ), 'https://github.com/projectcalico/calico-docker/blob/{version}/README.md') ] # Load the globally required release data. release_data = utils.load_release_data() # ============== Define the release steps. =============== def start_release(): """ Start the release process, asking user for version information. :return: """ para("Step 1 of 5: Create and push release branch with new versions.") para("Your git repository should be checked out to the correct revision " "that you want to cut a release with. This is usually the HEAD of " "the master branch.") utils.check_or_exit("Are you currently on the correct revision")