Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Mikejmnez
Copy link
Collaborator

@Mikejmnez Mikejmnez commented Dec 17, 2024

This is a draft
The following Pull Request:

example

This is included in the testing

dmr = """
<Dataset name="foo">\n
<Int32 name="x">\n
    <Attribute name="attr" type="Float32">\n
        <Value></Value>\n
        <Value>2</Value>\n
        <Value value="1"/>\n</Attribute>\n
</Int32>\n
</Dataset>
"""
dom_et = DMRParser(dmr).node
dataset = DMRParser(dmr).init_dataset()
variables = get_variables(dom_et)
get_attributes(variables['x']['element'])['attr']

the last line returns the list for attribute 'attr'. All values, excep None, are Float32, associated with variable 'x' of type int32

[None, 2.0, 1.0]

@Mikejmnez Mikejmnez marked this pull request as ready for review December 17, 2024 22:30
@Mikejmnez
Copy link
Collaborator Author

@jgallagher59701 ready for review

@Mikejmnez
Copy link
Collaborator Author

actually - just realized that I am missing case 1 in #421 . Implementing this now.

@Mikejmnez
Copy link
Collaborator Author

Done. Added plenty of testing and made sure all 4 cases (and combination of them) described in #406 are covered

Copy link
Member

@jgallagher59701 jgallagher59701 left a comment

Choose a reason for hiding this comment

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

Approved, but I think some more commentary will help us a year from now. ;-)

@Mikejmnez Mikejmnez merged commit 4ff18b2 into pydap:main Dec 19, 2024
7 checks passed
@Mikejmnez Mikejmnez deleted the dmr_attrs branch May 17, 2025 21:47
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.

There are four ways to specify Attributes on DAP4 spec - Pydap should be able to parse all

2 participants