Get input parameters for pore surface binary.

    Get input parameters for pore_surface binary from zeo++ output,
    while keeping data provenance.
178401
def get_pore_surface_parameters(surface_area):
    
    PoreSurfaceParameters = DataFactory('phtools.surface')
    d = {
        'accessible_surface_area': surface_area.get_dict()['ASA_A^2'],
        'target_volume': 40e3,
        'sampling_method': 'random',
    }
    return PoreSurfaceParameters(dict=d)
105403
def _get_unsigned_params(conv):
    
    conv["sign_mask"] = 0
    conv["int_min"] = 0
    conv["int_mask"] = sum([2 ** i for i in range(conv["bin_point"], 
        conv["bits"])])
    conv["int_max"] = sum([2 ** i for i in range(conv["bits"] -
        conv["bin_point"])])
50160
def inputs_outputs(self):
        """"""
        r = fapi.get_inputs_outputs(self.namespace, self.name,
                                    self.snapshot_id, self.api_url)
        fapi._check_response_code(r, 200)
        return r.json()
128451
def get_params():
    '''  '''
    parser = argparse.ArgumentParser()
    parser.add_argument("--data_dir", type=str, default='/tmp/tensorflow/mnist/input_data', help="data directory")
    parser.add_argument("--dropout_rate", type=float, default=0.5, help="dropout rate")
    parser.add_argument("--channel_1_num", type=int, default=32)
    parser.add_argument("--channel_2_num", type=int, default=64)
    parser.add_argument("--conv_size", type=int, default=5)
    parser.add_argument("--pool_size", type=int, default=2)
    parser.add_argument("--hidden_size", type=int, default=1024)
    parser.add_argument("--learning_rate", type=float, default=1e-4)
    parser.add_argument("--batch_num", type=int, default=2700)
    parser.add_argument("--batch_size", type=int, default=32)

    args, _ = parser.parse_known_args()
    return args
671554
def _get_input_args(bam_file, data, out_base, background):
    
    if dd.get_genome_build(data) in ["hg19"]:
        return ["--PileupFile", _create_pileup(bam_file, data, out_base, background)]
    else:
        return ["--BamFile", bam_file]
1261596
def sampling_params(self):
        
        if self.sampling_transforms is None:
            sampling_params = self.variable_params
        else:
            sampling_params = self.sampling_transforms.sampling_params
        return sampling_params
1024191
def getParamValues(self, paramName=None, paramId=None, useOnlyValids=True):
        
        
        if not paramName is None:
            if not paramId is None:
                if getParameterTypeNameFromID(paramId) != paramName:
                    raise ValueError("Parameters paramId and paramName "
                                    + "passed to ParamSample.getParamValues() are incompatible.")
        else:
            if paramId is None:
                raise ValueError("At least one of the attribute paramName and paramId "
                                    + "passed to ParamSample.getParamValues() most not be None.")
            paramName = getParameterTypeNameFromID(paramId)
        
        df = self.sampleDF
        if useOnlyValids:
            df = df[df["isValid"] == True]

        df.loc[:, "paramNames"] = [getParameterTypeNameFromID(param.typeId) for param in df["obj_parameter"]]

        return df[df["paramNames"] == paramName]
393119
def get_params(self):
        
        assert self.binded and self.params_initialized

        if self._params_dirty:
            self._sync_params_from_devices()
        return (self._arg_params, self._aux_params)
443848
def parameters(self):
        
        if self._parameters is None:
            self.__init()
        for param in self._parameters:
            if not isinstance(param['defaultValue'], BaseGPObject):
                if param['dataType'] == "GPFeatureRecordSetLayer":
                    param['defaultValue'] = GPFeatureRecordSetLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPString":
                    param['defaultValue'] = GPString.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLong":
                    param['defaultValue'] = GPLong.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDouble":
                    param['defaultValue'] = GPDouble.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDate":
                    param['defaultValue'] = GPDate.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPBoolean":
                    param['defaultValue'] = GPBoolean.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDataFile":
                    param['defaultValue'] = GPDataFile.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLinearUnit":
                    param['defaultValue'] = GPLinearUnit.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPMultiValue":
                    param['defaultValue'] = GPMultiValue.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterData":
                    param['defaultValue'] = GPRasterData.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterDataLayer":
                    param['defaultValue'] = GPRasterDataLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRecordSet":
                    param['defaultValue'] = GPRecordSet.fromJSON(json.dumps(param))
        return self._parameters
893110
def get_params(self):
        
        return self.timeout, self.xonxoff, self.rtscts, self.baudrate
600967
def layerData(self):
        
        output = {}
        
        output['visible'] = self.isVisible()
        output['zValue']  = self.zValue()
        output['current'] = self.isCurrent()
        
        return output
501989
def in_hull_volume(self):
        
        """
        i = self.network['pore.internal']
        s = self.network['pore.surface']
        d = self.network['pore.delaunay']
        Ps = self.network.pores()[np.logical_and(d, np.logical_or(i, s))]
        inds = self.network._map(ids=self['pore._id'][Ps], element='pore',
                                 filtered=True)
        # Get the fiber image
        self._get_fiber_image(inds)
        hull_image = np.ones_like(self._fiber_image, dtype=np.uint16)*-1
        self._hull_image = hull_image
        for pore in Ps:
            logger.info("Processing Pore: "+str(pore+1)+" of "+str(len(Ps)))
            verts = self['pore.vertices'][pore]
            verts = np.asarray(unique_list(np.around(verts, 6)))
            verts /= self.network.resolution
            self.inhull(verts, pore)
        self._process_pore_voxels()
1371563
def zGetSurfaceData(self, surfNum):
        """"""
        if self.pMode == 0: # Sequential mode
            surf_data = _co.namedtuple('surface_data', ['radius', 'thick', 'material', 'semidia', 
                                                        'conic', 'comment'])
            surf = self.pLDE.GetSurfaceAt(surfNum)
            return surf_data(surf.pRadius, surf.pThickness, surf.pMaterial, surf.pSemiDiameter,
                             surf.pConic, surf.pComment)
        else:
            raise NotImplementedError('Function not implemented for non-sequential mode')
753285
def _get_hyperparameter_solution_size(meta_parameters):
    
    # WARNING: meta_parameters is modified inline

    solution_size = 0
    for _, parameters in meta_parameters.iteritems():
        if parameters['type'] == 'discrete':
            # Binary encoding of discrete values -> log_2 N
            num_values = len(parameters['values'])
            binary_size = helpers.binary_size(num_values)
        elif parameters['type'] == 'int':
            # Use enough bits to cover range from min to max
            # + 1 to include max in range
            int_range = parameters['max'] - parameters['min'] + 1
            binary_size = helpers.binary_size(int_range)
        elif parameters['type'] == 'float':
            # Use enough bits to provide fine steps between min and max
            float_range = parameters['max'] - parameters['min']
            # * 1000 provides 1000 values between each natural number
            binary_size = helpers.binary_size(float_range * 1000)
        else:
            raise ValueError('Parameter type "{}" does not match known values'.
                             format(parameters['type']))

        # Store binary size with parameters for use in decode function
        parameters['binary_size'] = binary_size

        solution_size += binary_size

    return solution_size
308636
def kpoints(self):
        

        # To get input sets, the input structure has to has the same number
        # of required parameters as a Structure object.

        kpt = super().kpoints
        kpt.comment = "Generated by pymatgen's MVLGBSet"
        kpt.style = 'Gamma'

        # use k_product to calculate kpoints, k_product = kpts[0][0] * a
        lengths = self.structure.lattice.abc
        kpt_calc = [int(self.k_product / lengths[0] + 0.5),
                    int(self.k_product / lengths[1] + 0.5),
                    int(self.k_product / lengths[2] + 0.5)]

        if self.slab_mode:
            kpt_calc[2] = 1

        kpt.kpts[0] = kpt_calc

        return kpt
1096192
def parameters(self):
        
        libfn = utils.get_lib_fn('getTransformParameters%s'%self._libsuffix)
        return np.asarray(libfn(self.pointer), order='F')
693850
def getDefaultL2Params(self, inputSize, numInputBits):
    
    if numInputBits == 20:
      sampleSizeProximal = 10
      minThresholdProximal = 5
    elif numInputBits == 10:
      sampleSizeProximal = 6
      minThresholdProximal = 3
    else:
      sampleSizeProximal = int(numInputBits * .6)
      minThresholdProximal = int(sampleSizeProximal * .6)

    return {
      "inputWidth": inputSize * 16,
      "cellCount": 4096,
      "sdrSize": 40,
      "synPermProximalInc": 0.1,
      "synPermProximalDec": 0.001,
      "initialProximalPermanence": 0.6,
      "minThresholdProximal": minThresholdProximal,
      "sampleSizeProximal": sampleSizeProximal,
      "connectedPermanenceProximal": 0.5,
      "synPermDistalInc": 0.1,
      "synPermDistalDec": 0.001,
      "initialDistalPermanence": 0.41,
      "activationThresholdDistal": 13,
      "sampleSizeDistal": 20,
      "connectedPermanenceDistal": 0.5,
      "seed": self.seed,
      "learningMode": True,
    }