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

Add the Scene class #220

Merged
merged 13 commits into from
Sep 26, 2024
Merged

Add the Scene class #220

merged 13 commits into from
Sep 26, 2024

Conversation

jp-dark
Copy link
Collaborator

@jp-dark jp-dark commented Sep 13, 2024

  • Create the Scene class
  • Add spatial collection of scenes to the Experiment class
  • Add Scene to ephemeral collections and tests

This PR is ready for review, but should be merged after PR #219

- Add new MultiscaleImage
- Add new SpatialDataframe abstract base class
- Add PointCloud subclass of the SpatialDataFrame
- Add GeometryDataFrame subclass of the SpatialDataFrame
- Add shapely as a dependency
* Update docstrings
* Add ValueError error messages in `SpatialRead`
* Rename method `read_level`->`read_region`
The individual implementations may find a shared base class useful, but
it doesn't need to be included in the abstract specification.
* Create the `Scene` class
* Add `spatial` collection of scenes to the `Experiment` class
* Add Scene to ephemeral collections and tests
@jp-dark
Copy link
Collaborator Author

jp-dark commented Sep 20, 2024

[sc-55577], [sc-55578], [sc-55579]

Copy link

@ivirshup ivirshup left a comment

Choose a reason for hiding this comment

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

I think this will need another pass from me, but I left comments about some of the more high level parts of this PR I'm not sure if I understand.

python-spec/src/somacore/scene.py Show resolved Hide resolved
python-spec/src/somacore/scene.py Outdated Show resolved Hide resolved
Comment on lines 115 to 122
If the subcollection the geometry dataframe is inside of is more than one
layer deep, the input should be provided as a sequence of names. For example,
to register a geometry dataframe named "transcripts" in the "var/RNA"
collection::

scene.register_geometry_dataframe(
'transcripts', transform, subcollection=['var', 'RNA'],
)

Choose a reason for hiding this comment

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

Is this a workflow that is being supported? I thought the spec was pretty opinionated about where each kind of thing would be stored.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The example in the docstring follows the storage guideline and is more than one layer deep.

Copy link
Member

@aaronwolen aaronwolen left a comment

Choose a reason for hiding this comment

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

Had a few naming suggestions but otherwise looks great.

python-spec/src/somacore/scene.py Outdated Show resolved Hide resolved
raise NotImplementedError()

@abc.abstractmethod
def get_transformation_to_multiscale_image(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def get_transformation_to_multiscale_image(
def get_transformation_multiscale_image(

Do we need to here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need something to specify what the transform is going from/to. (Scene to image is different than image to scene). I don't love how verbose the methods are, so I'm open to other suggestions. I did change transformation to match transform (based on one of your suggestion changes on #219).

* Add methods to add new assets to a scene
* Rename `register_*` methods to `set_transformation_to_*`
* Rename `_transformation_` methods to `_transform_`.
* Add ability to get transforms "from" as well as "to" assets.
Base automatically changed from dark/spatial-datatypes to main September 26, 2024 16:28
An error occurred while trying to automatically change base from dark/spatial-datatypes to main September 26, 2024 16:28
@jp-dark jp-dark marked this pull request as ready for review September 26, 2024 17:55
@jp-dark jp-dark merged commit b53cd2b into main Sep 26, 2024
6 checks passed
@jp-dark jp-dark deleted the dark/scene branch September 26, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants