Skip to content

Group print hierarchy #82

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

Closed
alimanfoo opened this issue Oct 7, 2016 · 9 comments
Closed

Group print hierarchy #82

alimanfoo opened this issue Oct 7, 2016 · 9 comments
Labels
enhancement New features or improvements in progress Someone is currently working on this release notes done Automatically applied to PRs which have release notes.
Milestone

Comments

@alimanfoo
Copy link
Member

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

@jakirkham
Copy link
Member

Maybe something like a visitor pattern ( https://github.com/alimanfoo/zarr/issues/92 ) would help with this.

@alimanfoo
Copy link
Member Author

alimanfoo commented Nov 30, 2016 via email

@jakirkham
Copy link
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.

@mrocklin
Copy link
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

@jakirkham
Copy link
Member

jakirkham commented Nov 30, 2016

This may be an option. ( https://github.com/mbr/asciitree )

@alimanfoo
Copy link
Member Author

alimanfoo commented Nov 30, 2016 via email

@alimanfoo alimanfoo modified the milestone: v2.2 Dec 15, 2016
@jakirkham
Copy link
Member

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

@alimanfoo
Copy link
Member Author

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

@jakirkham jakirkham mentioned this issue Mar 3, 2017
@jakirkham
Copy link
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.

@alimanfoo alimanfoo mentioned this issue Apr 6, 2017
@alimanfoo alimanfoo added the in progress Someone is currently working on this label Oct 31, 2017
@alimanfoo alimanfoo added enhancement New features or improvements release notes done Automatically applied to PRs which have release notes. labels Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or improvements in progress Someone is currently working on this release notes done Automatically applied to PRs which have release notes.
Projects
None yet
Development

No branches or pull requests

3 participants