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

Difference between .coords and .coordinates #130

Closed
mlshapiro opened this issue Oct 26, 2018 · 4 comments
Closed

Difference between .coords and .coordinates #130

mlshapiro opened this issue Oct 26, 2018 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@mlshapiro
Copy link
Contributor

Description
Question: What is the difference between the .coords on ArrayCoordinates1D and .coordinates properties on Coordinates1D?

From the spec for Coordinates1D:

- `coordinates`: read-only array

From the spec for ArrayCoordinates1D:

Traits:
 - `coords`: array
@mlshapiro mlshapiro added the question Further information is requested label Oct 26, 2018
@jmilloy
Copy link
Collaborator

jmilloy commented Oct 26, 2018

The coordinates is a common read-only property of all Coordinates1d.

ArrayCoordinates1d uses coords trait to maintain its coordinate values, just like UniformCoordinates1d uses start, stop, and step for its coordinate values. Each implements the coordinates property, which of course returns a copy of the coords for ArrayCoordinates1d.

If you want to change the coordinates of an ArrayCoordinates1d, you can use c.coords = [0, 1, 2] but not c.coordinates = [0, 1, 2].

@jmilloy
Copy link
Collaborator

jmilloy commented Oct 26, 2018

We could make the coords private if you want (but probably not start, stop and step).

@mlshapiro
Copy link
Contributor Author

perfect - thank you for the explanation. I will add this explanation to the spec.

I ended up making some notebooks for each of these classes so that I don't have to keep writing examples as I'm trying to develop. Thats where these questions are coming from, mostly just trying to understand.

@jmilloy
Copy link
Collaborator

jmilloy commented Oct 26, 2018

My understanding was that the developer specs would be abandoned once implemented and eventually removed, in favor of the user guides and docstrings, and that @mpu-creare advised us not to worry about maintaining the dev specs if the implementation deviated. The coordinates user guide and docstrings are not complete (#45, #4) but should be soon; I'd put updates for clarification in those locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants