Skip to content

Group print hierarchy #82

Closed
Closed

Description

@alimanfoo

Consider implementing a method on the Group class like "describe" or "ls" which will print whole hierarchy for a given hierarchy depth.

Activity

  1. jakirkham commented on Nov 30, 2016

    @jakirkham
    Member
  2. alimanfoo commented on Nov 30, 2016

    @alimanfoo
    MemberAuthor
  3. jakirkham commented on Nov 30, 2016

    @jakirkham
    Member

    Sure, that would be good too. Maybe diagrams could be made akin to those used in Dask's graphs. Wonder if @mrocklin has any suggestions.

  4. mrocklin commented on Nov 30, 2016

    @mrocklin
    Contributor

    I would personally stick to ASCII. I would look at what PyTables does as well as bash tools like tree

    mrocklin@carbon:~/workspace$ tree zarr
    zarr
    ├── appveyor.yml
    ├── bench
    │   ├── compress_normal.py
    │   └── compress_normal.txt
    ├── build.cmd
    ├── c-blosc
    ├── cpuinfo.py
    ├── docs
    │   ├── api
    │   │   ├── codecs.rst
    │   │   ├── core.rst
    │   │   ├── creation.rst
    │   │   ├── hierarchy.rst
    │   │   ├── storage.rst
    │   │   └── sync.rst
    │   ├── api.rst
    │   ├── conf.py
    │   ├── index.rst
    │   ├── Makefile
    │   ├── release.rst
    │   ├── spec
    │   │   ├── v1.rst
    │   │   └── v2.rst
    │   ├── spec.rst
    │   ├── _static
    │   │   └── donotdelete
    │   └── tutorial.rst
    ├── LICENSE
    ├── MANIFEST.in
    ├── notebooks
    │   ├── blosc_microbench.ipynb
    │   ├── dask_2d_subset.ipynb
    │   ├── dask_copy.ipynb
    │   ├── dask_count_alleles.ipynb
    │   ├── genotype_benchmark_compressors.ipynb
    │   └── zip_benchmark.ipynb
    ├── README.rst
    ├── release.txt
    ├── requirements_rtfd.txt
    ├── requirements_test.txt
    ├── requirements.txt
    ├── setup.py
    ├── tox.ini
    └── zarr
        ├── attrs.py
        ├── blosc.c
        ├── blosc.pyx
        ├── codecs.py
        ├── compat.py
        ├── core.py
        ├── creation.py
        ├── errors.py
        ├── hierarchy.py
        ├── __init__.py
        ├── meta.py
        ├── meta_v1.py
        ├── storage.py
        ├── sync.py
        ├── tests
        │   ├── __init__.py
        │   ├── test_attrs.py
        │   ├── test_codecs.py
        │   ├── test_core.py
        │   ├── test_creation.py
        │   ├── test_filters.py
        │   ├── test_hierarchy.py
        │   ├── test_meta.py
        │   ├── test_storage.py
        │   ├── test_sync.py
        │   └── test_util.py
        └── util.py
    
    9 directories, 62 files
    
  5. jakirkham commented on Nov 30, 2016

    @jakirkham
    Member
  6. alimanfoo commented on Nov 30, 2016

    @alimanfoo
    MemberAuthor
  7. modified the milestone: v2.2 on Dec 15, 2016
  8. jakirkham commented on Mar 2, 2017

    @jakirkham
    Member

    If you want to go the standard library way, maybe pprint would work. Though IMHO asciitree still looks pretty good.

  9. alimanfoo commented on Mar 2, 2017

    @alimanfoo
    MemberAuthor

    Yep asciitree looks good. Can be configured to produce output very similar to linux tree command:

    >>> box_tr = LeftAligned(draw=BoxStyle(gfx=BOX_LIGHT, horiz_len=2, label_space=1))
    >>> print(box_tr(tree))
    asciitree
     ├── sometimes
     │   └── you
     ├── just
     │   └── want
     │       ├── to
     │       └── draw
     ├── trees
     └── in
         └── your
             └── terminal
    
  10. jakirkham commented on Mar 3, 2017

    @jakirkham
    Member

    Wanted to see how easy this would be now that we have visitor-style methods. Went ahead and threw together PR ( https://github.com/alimanfoo/zarr/pull/140 ). FWICT it seems to work ok.

    That said, I don't know that I will be able to do lots of iteration on it near term. So if you are wanting to get it in quickly, please feel free to run with it.

  11. added
    enhancementNew features or improvements
    release notes doneAutomatically applied to PRs which have release notes.
    on Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvementsin progressSomeone is currently working on thisrelease notes doneAutomatically applied to PRs which have release notes.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions