Skip to content
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

Update celltype docs #1722

Merged
merged 5 commits into from
Oct 28, 2016
Merged

Conversation

moradology
Copy link
Contributor

@moradology moradology commented Oct 27, 2016

This PR should include all CellType documentation. Still being worked on: the piece concerning code still in flight from #1702. I'm going to go ahead and write that part up, as I don't think the API is likely to change a great deal prior to 1.0

Closes #1580 and #1508

Copy link
Contributor

@fosskers fosskers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely clear content, I learned a lot.

Since the text itself isn't too long, this might benefit from being moved right into core-concepts.md itself, to keep the ToC small.


The above table lists `CellType` `DataType`s in the leftmost column
and `NoData` policies along the top row. A couple of points are worth
making here:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a space here will fix the rendering.

/** A custom, 'user defined' NoData CellType for comparison; we will
treat 42 as `NoData` for this one */
val customCellType = IntUserDefinedNoDataValue(42)
val customTile = IntArrayTile(myData, 2, 2, myNormalCellType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

myNormalCellType -> customCellType?

(no matter your underlying type, `get` on a tile will return an `Int`
and `getDouble` will return a `Double` */
assert(customTile.get(0, 0) == Int.MinValue)
assert(customTile.getDouble(0, 0) == Double.NaN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moradology moradology changed the title [WIP] Update celltype docs Update celltype docs Oct 27, 2016

In addition to keeping track of the memory used by each cell in a tile,
the cell type is where decisions about which values count as data (and
which, if any, are treated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIP?

/** While the value in (0, 0) is NoData, it is now 1 instead of 42
(which matches our new CellType's expectations) */
val converted = tileBefore.convert(IntUserDefinedNoData(1))
assert(converted.getRaw.get(0, 0) !== converted.get(0, 0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!=?


/** Here, the first value is still 42. But because the NoData value is
now 1, the first value is no longer treated as NoData */
(which matches our new CellType's expectations) */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some weirdness with */ here.


/** Here, the first value is still 42. But because the NoData value is
* now 1, the first value is no longer treated as NoData
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The */ here is causing weirdness with the next line.

@fosskers fosskers merged commit 28103cd into locationtech:docs-overhaul Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants