-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish between GIDCollections with or without metadata #8
Comments
@stinebuu: I like the print-out
a lot! Regarding the semantics of |
Re the printing: I just wanted to observe that the printing style might suggest the presence of a certain underlying data structure. Printing Re getting properties from the "layer" itself or from the nodes within the layer, is the solution proposed by @hep here under "Inhomogenous collections", point 4.iii, workable? #1 (comment) |
I tend to agree with @clinssen about the printing, and is a bit hesitant about suggesting a hierarchy where there is none. I do see that that way of printing makes it extremely easy to spot the difference between @clinssen Regarding your last point, about point 4.iii. It is not really applicable for layers, because a layer is a Primitive GIDCollection, and not an Inhomogenous (or composite) one. That is because with nest-3, layers can only contain one element type, so all nodes in the layer are of the same model. And so layers are automatically a Primitive GIDCollection. It is good you bring it up though, because we (or at least I) have not really thought of composite GIDCollections when working on |
We discussed printing at NMBU yesterday. To make sure we don't suggest an inheritance hierarchy, it might be an idea to merge the two print ideas. That is, show the type, but keep the pythonian print:
Another question that has come up, is what we then would do with Composite GIDCollections. Printing
We could also add brackets around each |
@stinebuu Looks nice to me. Instead of brackets I would suggest semicolons for partitioning. I would also suggest to change
|
@jougs @clinssen Concerning the name of the property carrying metadata information, I don't think that using for gc in net:
e = gc.metadata['extent'] would only work if all entries in
We can discuss if Create() # plain layer
CreateSpatial() # layer with spatial metadata but Create() # plain layer
Create(..., spatial={...}) # layer with spatial metadata I think this leads to a consistent and reasonably pythonesque UI. |
@stinebuu, @heplesser: I very much like the final state you arrived at and would be fine if you implemented it that way. |
This is a continuation of a discussion carried out on e-mail by @babsey, @heplesser, @hakonsbm and me. See also #1, #4 and nest#455 for other discussions on NEST-3 semantics.
The issue concerns two points about distinguishing between a plain
GIDCollection
and aGIDCollection
with metadata. So far the only collection with metadata is layers.Show metadata type when printing
We should have a way of discerning if a
GIDCollection
has metadata or not, and if it has metadata, what kind. A way to distinguish between the two would be to show the information while printing theGIDCollection
. Suggestions to printing outputs areor, closer to normal Python print rules
Add property for metadata information and let
get()
return node informationRight now
get()
returns something different if we have a layer or if we have a plainGIDCollection
. On a layer,get()
returns layer information,extent
,rows
etc, while it returns information about the nodes in a normalGIDCollection
:But, as a layer is a
GIDCollection
(with added metadata) this might not be what one anticipates. It could therefore be better if instead of usingget()
to return layer information, we add a property returning metadata information forGIDCollection
s with metadata, something likeThe property name (geometry) could depend on the metadata type.
The text was updated successfully, but these errors were encountered: