.
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 type |
---|---|
< | strict subtype |
<= | subtype |
>= | supertype |
> | strict supertype |
:
KindWithAltOperator | Returned kind in terms of original class |
---|---|
< | strict subclass |
<= | subclass |
>= | superclass |
> | strict superclass |
:
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.
byclass:
IdentitySet.
byclodo:
IdentitySet.
byid:
IdentitySet.
bymodule:
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.
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.Class | hp.Type.Type | hp.Type.Module.dictof | hp.Type.Class.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+.
byclass:
IdentitySet.
byclodo:
IdentitySet.
byid:
IdentitySet.
bymodule:
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.
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.
theone:
Any:
IdentitySetNotEmpty.
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 1 object. Total size = 32 bytes. Index Count % Size % Cumulative % Kind (class / dict of class) 0 1 100 32 100 32 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 = 172 bytes. Index Count % Size % Cumulative % Type & Individual Size 0 2 40 120 70 120 70 list & 60 1 1 20 28 16 148 86 list & 28 2 2 40 24 14 172 100 int & 12 >>>
:
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. )
Class | Clodo | Id | Module | Rcs | Size | Type | Unity | Size&Type | |
---|---|---|---|---|---|---|---|---|---|
< | Class | ||||||||
< | 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 1512 objects. Total size = 715008 bytes. Index Count % Size % Cumulative % Dict of Individual Size 0 140 9 225056 31 225056 31 dict of 24 1 336 22 172800 24 397856 56 dict of 44 2 582 38 152112 21 549968 77 dict (no owner) 3 347 23 92120 13 642088 90 dict of 32This 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+