Skip to content

Use more standard package structure, protect vendored phasenet package #13

Description

@claudiodsf

Hi Jean-Marie,

I just saw your recent PR #12. I think it introduces two problems:

  1. The directory name phaseworm_sources does not respect the general recommendation, which is to name this directory like the package (i.e. phaseworm).

In its current form, when one does pip install ., she will get the following directories in the site-packages directory:

➜  ~ conda activate phaseworm
(phaseworm) ➜  ~ ls -lrt $CONDA_PREFIX/lib/python*/site-packages
...
drwxr-xr-x  13 claudio staff    416 Apr 12 09:06 phasenet
drwxr-xr-x   9 claudio staff    288 Apr 12 09:06 phaseworm_sources
drwxr-xr-x  11 claudio staff    352 Apr 12 09:06 phaseworm-1.1.dist-info

It would be better, in my opinion (and for coherency with other installed packages in site-packages) to drop the suffix _sources.

  1. The above directory listing also illustrates the second problem: phaseworm distributes its own specific version of phasenet (this is technically called "vendoring"). Currently, phasenet is installed as a top-level package, meaning that a pip install phasenet will overwrite the version shipped with phaseworm, with the possibility of generating weird bugs.
    To protect this specific version, it should go inside the phaseworm directory.

So, my proposed directory structure is:

phaseworm
├── CITATION.cff
├── CONTRIBUTORS.txt
├── LICENSE.txt
├── MANIFEST.in
├── README.md
├── doc
│   └── flow-chart.png
├── examples
│   ├── config.cfg
│   ├── config_replay.cfg
│   └── config_rt.cfg
├── phaseworm
│   ├── __init__.py
│   ├── get_data.py
│   ├── hinv_station_rw.py
│   ├── phasenet
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── app.py
│   │   ├── data_reader.py
│   │   ├── detect_peaks.py
│   │   ├── model
│   │   │   └── 190703-214543
│   │   │       ├── checkpoint
│   │   │       ├── config.log
│   │   │       ├── loss.log
│   │   │       ├── model_95.ckpt.data-00000-of-00001
│   │   │       ├── model_95.ckpt.index
│   │   │       └── model_95.ckpt.meta
│   │   ├── model.py
│   │   ├── requirements.txt
│   │   ├── run.py
│   │   ├── test_app.py
│   │   └── util.py
│   ├── phaseworm.py
│   ├── read_config.py
│   └── stationxml2hinv.py
└── setup.py

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions