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

.hdf5.ls change to prevent printing to stdout #35

Closed
sshanks-kx opened this issue Sep 13, 2022 · 1 comment
Closed

.hdf5.ls change to prevent printing to stdout #35

sshanks-kx opened this issue Sep 13, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sshanks-kx
Copy link
Contributor

Return details so user in control of whether to print to stdout/parse/etc, rather than printing.

@sshanks-kx sshanks-kx added the enhancement New feature or request label Sep 13, 2022
@sshanks-kx sshanks-kx self-assigned this Sep 13, 2022
@sshanks-kx
Copy link
Contributor Author

Now creates a dict (keys 'type','name',value'). When an entry is a group, its value contains a dict (and so on)

the following

{
  Group: kdb_table {
    Dataset: Latitude
    Dataset: Longitude
    Dataset: Name
    Dataset: Pressure
    Dataset: Temperature
  }
}

ends up as

q)a
type | group                                                                 ..
name | `kdb_table                                                            ..
value| `type`name`value!(`dataset`dataset`dataset`dataset`dataset;(`Latitude;..

q)(a`value)[0]
type | dataset         dataset         dataset         dataset         datase..
name | `Latitude       `Longitude      `Name           `Pressure       `Tempe..
value| (`symbol$())!() (`symbol$())!() (`symbol$())!() (`symbol$())!() (`symb..

or for this example

{
  Group: Domain_03 {
    Group: OSBS {
      Group: min_1 {
        Group: boom_1 {
          Dataset: temperature
        }
        Group: boom_2 {
          Dataset: temperature
        }
        Group: boom_3 {
          Dataset: temperature
        }
        Group: boom_5 {
          Dataset: temperature
        }
        Group: tower_top {
          Dataset: temperature
        }
      }
      Group: min_30 {
        Group: boom_1 {
          Dataset: temperature
        }
        Group: boom_2 {
          Dataset: temperature
        }
        Group: boom_3 {
          Dataset: temperature
        }
        Group: boom_5 {
          Dataset: temperature
        }
        Group: tower_top {
          Dataset: temperature
        }
      }
    }
  }
  Group: Domain_10 {
    Group: STER {
      Group: min_1 {
        Group: boom_1 {
          Dataset: temperature
        }
        Group: boom_2 {
          Dataset: temperature
        }
        Group: boom_3 {
          Dataset: temperature
        }
      }
      Group: min_30 {
        Group: boom_1 {
          Dataset: temperature
        }
        Group: boom_2 {
          Dataset: temperature
        }
        Group: boom_3 {
          Dataset: temperature
        }
      }
    }
  }
}

now ends up as

q)a
type | group                                                                 ..
name | `Domain_03                                                            ..
value| `type`name`value!(,`group;,`OSBS;,`type`name`value!(`group`group;(`min..
q)(a`value)[0]
type | group                                                                 ..
name | `OSBS                                                                 ..
value| `type`name`value!(`group`group;(`min_1;`min_30);(`type`name`value!(`gr..
q)((a`value)[0]`value)[0]                    
type | group                                                                 ..
name | `min_1                                                                ..
value| `type`name`value!(`group`group`group`group`group;(`boom_1;`boom_2;`boo..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant