コード例 #1
0
def save():
    dir = ''
    dir = os.environ.get('SUGAR_ACTIVITY_ROOT')
    if dir == None: dir = ''
    fname = os.path.join(dir, 'data', 'iq.dat')
    f = open(fname, 'w')
    load_save.save(f)
    f.close
コード例 #2
0
def save():
    directory = ''
    directory = os.environ.get('SUGAR_ACTIVITY_ROOT')
    if directory is None:
        directory = ''
    fname = os.path.join(directory, 'data', 'follow.dat')
    f = open(fname, 'w')
    load_save.save(f)
    f.close
コード例 #3
0
ファイル: utils.py プロジェクト: i5o/spirolaterals-1
def save():
    dir = ''
    dir = os.environ.get('SUGAR_ACTIVITY_ROOT')
    if dir is None:
        dir = ''
    fname = os.path.join(dir, 'data', 'spiro.dat')
    f = open(fname,  'w')
    load_save.save(f)
    f.close
コード例 #4
0
    def save_checkpoint(self, res):
        x_values = [[float(val) for val in point] for point in res.x_iters]
        y_values = [-val for val in res.func_vals]

        res_dict = {}
        for i, dimension in enumerate(self.search_space):
            res_dict[dimension.name] = []
            for point in x_values:
                res_dict[dimension.name].append(point[i])
        res_dict['value'] = y_values

        load_save.save(self.output_file, res_dict)
コード例 #5
0
ファイル: utils.py プロジェクト: i5o/letters
def save():
    directory = ''
    directory = os.environ.get('SUGAR_ACTIVITY_ROOT')
    if directory is None:
        directory = ''
    fname = os.path.join(directory, 'data', 'Letters.dat')
    try:
        f = open(fname, 'w')
    except Exception as e:
        logging.error('Could not open %s: %s' % (fname, e))
        return
    load_save.save(f)
    f.close
コード例 #6
0
ファイル: utils.py プロジェクト: vipulgupta2048/triples
def save():
    directory = ''
    directory = os.environ.get('SUGAR_ACTIVITY_ROOT')
    if directory is None:
        directory = ''
    fname = os.path.join(directory, 'data', 'triples.dat')
    try:
        f = open(fname, 'w')
    except Exception as e:
        logging.error('Could not open %s: %s' % (fname, e))
        return
    load_save.save(f)
    f.close
コード例 #7
0
 def write_file(self, file_path):
     f = open(file_path, 'w')
     load_save.save(f)
     f.close()
コード例 #8
0
ファイル: activity.py プロジェクト: sugarlabs/numbers
 def write_file(self, file_path):
     f = open(file_path, 'w')
     load_save.save(f)
     f.close()
コード例 #9
0
    def save_values(self):
        """Save in the data file the known x_values and y_values

        """
        data_dict = self._pack_values()
        load_save.save(self.output_file, data_dict)