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 docval to accept fully qualified class names #1036

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Conversation

rly
Copy link
Contributor

@rly rly commented Jan 23, 2024

Motivation

Follow-up to #1031 to allow a "type" argument in docval that is the name of a class to be linked to its documentation.

How to test the behavior?

Use this syntax for 'type' if you want to create a proper doc link to the LinkSpec class:

@docval({'name': 'spec', 'type': 'hdmf.spec.spec.LinkSpec', 'doc': 'the specification for the object to link to'})
    def set_link(self, **kwargs):
        pass

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Does the PR clearly describe the problem and the solution?
  • Have you reviewed our Contributing Guide?
  • Does the PR use "Fix #XXX" notation to tell GitHub to close the relevant issue numbered XXX when the PR is merged?

@rly rly requested a review from stephprince January 23, 2024 01:59
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.52%. Comparing base (fa18cc5) to head (d8f8d5b).
Report is 65 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1036   +/-   ##
=======================================
  Coverage   88.51%   88.52%           
=======================================
  Files          45       45           
  Lines        9586     9594    +8     
  Branches     2725     2727    +2     
=======================================
+ Hits         8485     8493    +8     
  Misses        778      778           
  Partials      323      323           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rly rly enabled auto-merge (squash) January 23, 2024 02:02
Copy link
Contributor

@stephprince stephprince 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 one more type that could be changed with this new docval behavior is 'type': 'HERD' to 'type':'hdmf.common.resources.HERD'? It would apply here, here, and here

otherwise looks good to me!

tests/unit/test_io_hdf5_streaming.py Show resolved Hide resolved
@rly
Copy link
Contributor Author

rly commented Jan 24, 2024

I think one more type that could be changed with this new docval behavior is 'type': 'HERD' to 'type':'hdmf.common.resources.HERD'? It would apply here, here, and here

I am not sure how I missed that. Good catch!

@rly rly merged commit d5d6383 into dev Jan 24, 2024
28 checks passed
@rly rly deleted the docval_doc_class branch January 24, 2024 01:23
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.

2 participants