Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-schultz committed Nov 30, 2022
1 parent 031a54e commit b66c88b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions hail/python/hail/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def create(log: str,
global_seed=nullable(int),
backend=Backend)
def __init__(self, log, quiet, append, tmpdir, local_tmpdir, global_seed, backend):
import traceback
self._tb = traceback.extract_stack()
assert not Env._hc, ''.join(traceback.format_list(Env._hc._tb))
assert not Env._hc

self._log = log

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ object RandomSeededFunctions extends RegistryFunctions {
registerSCode5("rand_unif_nd", TRNGState, TInt64, TInt64, TFloat64, TFloat64, TNDArray(TFloat64, Nat(2)), {
case (_: Type, _: SType, _: SType, _: SType, _: SType, _: SType) => PCanonicalNDArray(PFloat64(true), 2, true).sType
}) { case (r, cb, rt: SNDArrayPointer, rngState: SRNGStateValue, nRows: SInt64Value, nCols: SInt64Value, min, max, errorID) =>
val result = rt.pType.constructUnintialized(FastIndexedSeq(SizeValueDyn(nRows.value), SizeValueDyn(nCols.value)), cb, r.region)
val result = rt.pType.constructUninitialized(FastIndexedSeq(SizeValueDyn(nRows.value), SizeValueDyn(nCols.value)), cb, r.region)
val rng = cb.emb.getThreefryRNG()
rngState.copyIntoEngine(cb, rng)
result.coiterateMutate(cb, r.region) { _ =>
Expand Down Expand Up @@ -139,7 +139,7 @@ object RandomSeededFunctions extends RegistryFunctions {
registerSCode5("rand_norm_nd", TRNGState, TInt64, TInt64, TFloat64, TFloat64, TNDArray(TFloat64, Nat(2)), {
case (_: Type, _: SType, _: SType, _: SType, _: SType, _: SType) => PCanonicalNDArray(PFloat64(true), 2, true).sType
}) { case (r, cb, rt: SNDArrayPointer, rngState: SRNGStateValue, nRows: SInt64Value, nCols: SInt64Value, mean, sd, errorID) =>
val result = rt.pType.constructUnintialized(FastIndexedSeq(SizeValueDyn(nRows.value), SizeValueDyn(nCols.value)), cb, r.region)
val result = rt.pType.constructUninitialized(FastIndexedSeq(SizeValueDyn(nRows.value), SizeValueDyn(nCols.value)), cb, r.region)
val rng = cb.emb.getThreefryRNG()
rngState.copyIntoEngine(cb, rng)
result.coiterateMutate(cb, r.region) { _ =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ final case class PCanonicalNDArray(elementType: PType, nDims: Int, required: Boo
constructByCopyingDataPointer(shape, strides, this.allocateData(shape, region), cb, region)
}

def constructUnintialized(
def constructUninitialized(
shape: IndexedSeq[SizeValue],
cb: EmitCodeBuilder,
region: Value[Region]
Expand Down

0 comments on commit b66c88b

Please sign in to comment.