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

Initial setup #11

Merged
merged 17 commits into from
Jun 5, 2024
Merged

Initial setup #11

merged 17 commits into from
Jun 5, 2024

Conversation

CodyCBakerPhD
Copy link
Member

Starting initial work on this since I needed a special extension for the Leifer lab and their electrically tunable lens (variable depth)

@CodyCBakerPhD CodyCBakerPhD self-assigned this May 5, 2024
@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review May 31, 2024 16:04
@CodyCBakerPhD
Copy link
Member Author

WDYT @alessandratrapani?

Tests are passing, should we get this in to serve as a base for further improvement?

Comment on lines +119 to +124
# TODO: deal with grid_spacing units
# attributes:
# - name: unit
# dtype: text
# default_value: micrometers
# doc: Measurement units for grid spacing. The default value is 'micrometers'.
Copy link
Member Author

Choose a reason for hiding this comment

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

BTW @rly

If I uncomment this part it errors out at io.write

    @docval({"name": "spec", "type": Spec, "doc": "the spec to get the attribute value for"},
            {"name": "container", "type": AbstractContainer, "doc": "the container to get the attribute value from"},
            {"name": "manager", "type": BuildManager, "doc": "the BuildManager used for managing this build"},
            returns='the value of the attribute')
    def get_attr_value(self, **kwargs):
        ''' Get the value of the attribute corresponding to this spec from the given container '''
        spec, container, manager = getargs('spec', 'container', 'manager', kwargs)
        attr_name = self.get_attribute(spec)
        if attr_name is None:
            return None
        attr_val = self.__get_override_attr(attr_name, container, manager)
        if attr_val is None:
            try:
>               attr_val = getattr(container, attr_name)
E               AttributeError: 'PlanarImagingSpace' object has no attribute 'grid_spacing__unit'

Any idea what's going on there?

What's especially odd is the origin_coordinates follows the same exact pattern but works fine

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the ping. This is an issue with HDMF that we haven't encountered before. I filed an issue here hdmf-dev/hdmf#1121 and created a fix here hdmf-dev/hdmf#1122.

I'll aim for a quick bugfix release early this week. Then grid_spacing__unit should work.

That said, I was thinking about the "unit" attribute for the ProbeModel.planar_contour argument in ndx-extracellular-channels. That is a set of coordinates that needs units too. I removed the ability of the user to set the unit, and changed planar_contour to planar_contour_in_um. I think there is little value in having the user set the unit. As per some of our recent discussions at the dev hackathon and before, data producers often just want to be told what to do to standardize their data, and software tools and data reusers have a hard time working with data that is too variable across datasets, e.g., when the names of the same kinds of objects differ across datasets for no good reason.

It's probably good to have the unit field and fix it to micrometers. By fixing it to that value, we can add _in_um to the name for extra clarity.

Just my two cents!

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I agree - let's do this in a small follow-up

@@ -1,72 +1,69 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be removed. Using the latest ndx-template, which I think you used here, this was replaced by pyproject.toml. The problem with this setup.py is that it copies the spec folder into /src/pynwb/ on install, and so if you make changes to /spec/ndx-microscopy.extensions.yaml, you might expect the changes to be reflected in your environment, but no, the cached yaml in /src/pynwb/spec/ is used instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense - we'll deal with it in a follow-up since the way I copied this base didn't have the hatchling stuff in the TOML

Copy link
Collaborator

@alessandratrapani alessandratrapani left a comment

Choose a reason for hiding this comment

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

Ok

@CodyCBakerPhD CodyCBakerPhD merged commit df5e8d4 into main Jun 5, 2024
33 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the basic_spec branch June 5, 2024 13:08
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.

3 participants