.
disjoint(y:
UniSet+) -> boolean.
get_ckc().
get_render() -> callable:
UniSet+ -> UniSet:
UniSet+ -> UniSet:
UniSet+ -> UniSet:
UniSet+ -> UniSet:
Any+ in x -> boolean:
UniSet+ -> boolean:
UniSet+ -> boolean:
UniSet+ -> boolean:
UniSet+ -> boolean:
UniSet+ -> boolean:
UniSet+ -> boolean.
biper:
EquivalenceRelation.
brief:
string.
dictof:
UniSet.
disjoint(y:
UniSet+) -> boolean
not (x & y)
but may be implemented more efficiently in some cases.
.
get_ckc()
.
get_render() -> callable
:
UniSet+ -> UniSet
:
UniSet+ -> UniSet
:
UniSet+ -> UniSet
:
UniSet+ -> UniSet
:
Any+ in x -> boolean
:
UniSet+ -> boolean
:
UniSet+ -> boolean
:
UniSet+ -> boolean
:
UniSet+ -> boolean
:
UniSet+ -> boolean
:
UniSet+ -> boolean
.
biper:
EquivalenceRelation.
brief:
string.
dictof:
UniSet:
UniSet:
Kind:
AltOperator+) -> Kind:
Kind:
AltOperator+) -> Kind
Operator | Returned kind in terms of original file name | Returned kind in terms of original line number |
---|---|---|
< | file name starts with original | line number < original |
<= | file name starts with original | line number <= original |
>= | original starts with file name | line number >= original |
> | original starts with file name | line number > original |
:
KindWithAltOperator | Returned kind in terms of original type |
---|---|
< | strict subtype |
<= | subtype |
>= | supertype |
> | strict supertype |
:
KindWithAltOperator | Returned kind in terms of original |
---|---|
< | size < original |
<= | size <= original |
>= | size >= original |
> | size > original |
:
KindWithAltOperator | Returned kind in terms of original |
---|---|
< | referred by less than the original set of kinds |
<= | referred by at most the original set of kinds |
>= | referred by at least the original set of kinds |
> | referred by more than the original set of kinds |
:
KindWithAltOperator | Returned kind in terms of original |
---|---|
< | referred via less than the original set of relations |
<= | referred via at most the original set of relations |
>= | referred via at least the original set of relations |
> | referred via more than the original set of relations |
:
KindWithAlt:
UniSet.
by(er:
EquivalenceRelation) -> IdentitySet.
diff(y:
IdentitySet) -> Stat.
dump(fn:
writeable_filename_or_file+ [mode
= writing_mode_string+]).
get_rp( draw:[depth
= positive+ , er
= EquivalenceRelation+ , imdom
= boolean+ , bf
= boolean+ , src
= IdentitySet+ , stopkind
= UniSet+ , nocyc
= boolean+]) -> ReferencePattern.
get_shpaths( draw:[src
= IdentitySet+ , avoid_nodes
= IdentitySet+ , avoid_edges
= NodeGraph+]) -> Paths.
byclodo:
IdentitySet.
byid:
IdentitySet.
bymodule:
IdentitySet.
byprod:
IdentitySet.
byrcs:
IdentitySet.
bysize:
IdentitySet.
bytype:
IdentitySet.
byunity:
IdentitySet.
byvia:
IdentitySet.
count:
notnegative.
dominos:
IdentitySet.
domisize:
notnegative.
er:
EquivalenceRelation.
imdom:
IdentitySet.
indisize:
notnegative.
kind:
Kind.
maprox:
MappingProxy.
more:
MorePrinter.
all:
MorePrinter.
nodes:
ImmNodeSet.
owners:
IdentitySet.
partition:
Partition.
parts:
iterable.
pathsin:
Paths.
pathsout:
Paths.
referents:
IdentitySet.
referrers:
IdentitySet.
rp:
ReferencePattern.
shpaths:
Paths.
size:
notnegative.
sp:
Paths.
stat:
Stat:
UniSet.
by(er:
EquivalenceRelation) -> IdentitySet
.
diff(y:
IdentitySet) -> Stat
x.stat - y.by(x.er).stat
"..
dump(fn:
writeable_filename_or_file+ [mode
= writing_mode_string+])
:
writeable_filename_or_file+mode
= writing_mode_string+.
get_rp( draw:[depth
= positive+ , er
= EquivalenceRelation+ , imdom
= boolean+ , bf
= boolean+ , src
= IdentitySet+ , stopkind
= UniSet+ , nocyc
= boolean+]) -> ReferencePattern
depth
= positive+er
= EquivalenceRelation+imdom
= boolean+bf
= boolean+src
= IdentitySet+stopkind
= UniSet+stopkind = ( hp.Type.Module | hp.Type.Type | hp.Type.Module.dictof | hp.Type.Type.dictof | hp.Type.Code | hp.Type.Frame )
nocyc
= boolean+.
get_shpaths( draw:[src
= IdentitySet+ , avoid_nodes
= IdentitySet+ , avoid_edges
= NodeGraph+]) -> Paths
src
= IdentitySet+avoid_nodes
= IdentitySet+avoid_edges
= NodeGraph+.
byclodo:
IdentitySet.
byid:
IdentitySet.
bymodule:
IdentitySet.
byprod:
IdentitySet.
byrcs:
IdentitySet.
bysize:
IdentitySet.
bytype:
IdentitySet.
byunity:
IdentitySet.
byvia:
IdentitySet.
count:
notnegative.
dominos:
IdentitySet.
domisize:
notnegative.
er:
EquivalenceRelation.
imdom:
IdentitySet.
indisize:
notnegative.
kind:
Kind.
maprox:
MappingProxy>>> hp.iso({'a':'b'}, {'a':1}).maprox['a'].byid Set of 2 <mixed> objects. Total size = 40 bytes. Index Size % Cumulative % Brief 0 28 70.0 28 70.0 str: 'b' 1 12 30.0 40 100.0 int: 1 >>>
.
more:
MorePrinter.
all:
MorePrinter.
nodes:
ImmNodeSet.
owners:
IdentitySet.
partition:
Partition.
parts:
iterable.
pathsin:
Paths.
pathsout:
Paths.
referents:
IdentitySet.
referrers:
IdentitySet.
rp:
ReferencePattern.
shpaths:
Paths.
size:
notnegative.
sp:
Paths.
stat:
Stat:
IdentitySet:
int+] -> IdentitySetNotEmpty:
IdentitySet:
int+] -> IdentitySetNotEmpty x[0]
will be the subset in the partition of x that uses the most memory.
:
IdentitySetNotEmpty.
prod:
MorePrinter.
theone:
Any:
IdentitySetNotEmpty.
prod:
MorePrinter.
theone:
Any:
UniSet.
sokind() -> SetOfKind:
UniSet+ in x -> boolean:
EquivalenceRelation+ -> EquivalenceRelation:
EquivalenceRelation+ -> boolean.
dictof:
EquivalenceRelationByDictOwner.
refdby:
EquivalenceRelation:
UniSet.
sokind() -> SetOfKind
>>> from guppy import hpy; hp=hpy() >>> hp.heap() & hp.Module.dictof.sokind(hp.Module('__main__')).refdby Partition of a set of 2 objects. Total size = 305 bytes. Index Count % Size % Cumulative % Kind (class / dict of class) 0 1 50 248 81 248 81 dict (no owner) 1 1 50 57 19 305 100 str >>>
:
UniSet+ in x -> boolean
The members of an equivalence relation in this implementation are defined to be the subsets of its equivalence classes. The inclusion test can be used to see if all elements of a set classify equal according to the classifier of an equivalence relation.
>>> from guppy import hpy; hp=hpy() >>> hp.iso([],[]) in hp.Size # Equal sizes True >>> hp.iso([],range(100)) in hp.Size # Different sizes False >>> hp.iso([],range(100)) in hp.Type # Equal types True >>> hp.iso([],xrange(100)) in hp.Type # Different types False >>> >>> hp.Size(56) in hp.Size # An equivalence class of hp.Size True >>> hp.Type.Int in hp.Size # Not an equivalence class of hp.Size False
:
EquivalenceRelation+ -> EquivalenceRelation
>>> from guppy import hpy; hp=hpy() >>> hp.iso(1, 10, [], [2], [3,4]).by(hp.Type & hp.Size) Partition of a set of 5 objects. Total size = 296 bytes. Index Count % Size % Cumulative % Type & Individual Size 0 1 20 88 30 88 30 list & 88 1 1 20 80 27 168 57 list & 80 2 1 20 72 24 240 81 list & 72 3 2 40 56 19 296 100 int & 28 >>>
:
EquivalenceRelation+ -> boolean
An EquivalenceRelation can only be a subrelation of another EquivalenceRelation. This is an explicitly defined relationship among the equivalence relations. In most cases the equivalence relations are disjoint, i.e. none is a subrelation of the other. But it is useful to know which ones are actually subrelations. The following table shows for each pair of predefined relations, whether the one at the top of the column is a strict subrelation of the one at the end of the row. ( I have included Size & Type as an example of an intersected equivalence relation. )
Clodo | Id | Module | Rcs | Size | Type | Unity | Size&Type | |
---|---|---|---|---|---|---|---|---|
< | Size | |||||||
< | < | Type | ||||||
< | < | < | < | < | < | < | Unity |
>>> hp.Class < hp.Type True >>> hp.Type < hp.Class False >>>
.
dictof:
EquivalenceRelationByDictOwner>>> from guppy import hpy; hp=hpy() >>> h=hp.heap()&dict >>> h.by(hp.Size.dictof) Partition of a set of 1013 objects. Total size = 529512 bytes. Index Count % Size % Cumulative % Dict of Individual Size 0 79 8 139704 26 139704 26 dict of 88 1 198 20 114712 22 254416 48 dict of 400 2 167 16 92384 17 346800 65 dict of 1064 3 172 17 81712 15 428512 81 dict (no owner) 4 53 5 29304 6 457816 86 dict of 896This shows that there are 140 dicts that are owned by some objects of size 24, 336 dicts that are owned by some objects of size 44, 582 dicts without owner and so on.
.
refdby:
EquivalenceRelationThe Use.Rcs equivalence relation is a special case of this construction, where the underlying equivalence relation is Use.Clodo. :
>>> hp.Clodo.refdby == hp.Rcs True
:
EquivalenceRelation:
x( alt:[k:
None+ or k:
Kind+]) -> Kind:
EquivalenceRelation:
x( alt:[k:
None+ or k:
Kind+]) -> Kind
:
None+ ~hp.Type.Dict
.:
Kind+