Comments (11)
to run MSNoise, my current idea is either to execute steps like this
(1.1) $ python -m msnoise --step 1
or
(1.2) $ python -m msnoise.s01scan_archive
or create a msnoise in Python/Scripts and
(2) $ msnoise --step 1
any suggestions ?
I remember reading some comment advocating for the first solution (written by someone fed up with the /scripts folder being super full)... But with the first (1.1) solution, it's not really easy to pass arguments to step 1
...
from msnoise.
The first version is nice for commands that are rarely called by users (e.g. tests, benchmarks, ...).
MSNoise on the other hand really focuses on actually using these commands so it is completely justified in my opinion to have a central msnoise
script that can (after installation) be called from everywhere.
Then you can design a git like interface (main command followed by the subcommand followed by the arguments), e.g.
$ msnoise scan_archive .
$ msnoise do_other_stuff --who=me /path/to/stuff
That is what I did here: http://lasif.net/cli.html (the documentation is actually autogenerated from the code with the help of a custom sphinx directive). My favorite part turned out to be the testing. A custom pytest fixture (https://github.com/krischer/LASIF/blob/5ad0ff11abe7703c3a9ae4507374389dee4e194f/lasif/tests/testing_helpers.py#L69-106) is used to make it really easy and clean to test the command line interface, e.g. https://github.com/krischer/LASIF/blob/5ad0ff11abe7703c3a9ae4507374389dee4e194f/lasif/tests/test_cli_interface.py#L108-L115
I coded the command dispatching and all the other stuff by hand: It is fairly straightforward to implement some nice features like fuzzy subcommand matching and pretty help messages. But nowadays I would just use something like this: http://click.pocoo.org
from msnoise.
Mmmm Thanks ! That sound reallllly cool : http://click.pocoo.org/3/quickstart/#nesting-commands
from msnoise.
Ok, so far so good, using Click
[test1] C:\Users\tlecocq\Desktop>msnoise
Usage: msnoise-script.py [OPTIONS] COMMAND [ARGS]...
Options:
-t, --threads INTEGER Nulmber of threads to use
--help Show this message and exit.
Commands:
bugreport
config
install
scan_archive
[test1] C:\Users\tlecocq\Desktop>msnoise bugreport --help
Usage: msnoise-script.py bugreport [OPTIONS]
Options:
-s, --sys System Info
-m, --modules Modules Info
-e, --env Environment Info
-a, --all All Info
--help Show this message and exit.
Cooooool :-)
from msnoise.
[test1] C:\Users\tlecocq\Desktop\tmprun>msnoise
Usage: msnoise-script.py [OPTIONS] COMMAND [ARGS]...
Options:
-t, --threads INTEGER Number of threads to use (only affects modules that
are designed to do parallel processing)
--help Show this message and exit.
Commands:
bugreport This command launches the Bug Report script.
compute_cc Computes the CC jobs (based on the "New Jobs"...
compute_dtt Computes the dt/t jobs based on the new MWCS...
compute_mwcs Computes the MWCS based on the new stacked...
config This command launches the Configurator.
install This command launches the installer.
new_jobs Determines if new CC jobs are to be defined
plot Top level command to trigger different plots
populate Rapidly scan the archive filenames and find...
reset Resets the job to "T"odo.
scan_archive Scan the archive and insert into the Data...
stack Stacks the [REF] and/or [MOV] windows
almost done :-)
from msnoise.
f945ba2 marks the first big (read -HUGE-) step toward packaging MSNoise !
from msnoise.
I think this can be considered done...
from msnoise.
I don't think this is really done TBH. For example the dependencies are not specified in the setup.py
and I am also not sure it installs everything it needs. A good test is always to install (without --develop
or -e
) to a clean virtual environment that only contains numpy and see if everything still works and if the tests can somehow be executed.
from msnoise.
aaah that... is correct :-)
from msnoise.
and at some point, when that looks ready, learn how to make a PyPi upload... :s
from msnoise.
I think it's OK...
from msnoise.
Related Issues (20)
- get msnoise plot dvv results HOT 2
- problem related to the number of data after steps
- msnoise plot dvv fail - parsererror, tokenizing data problem HOT 1
- filters and sampling rate question HOT 6
- compute_cc: unexpected EOF while parsing HOT 3
- sampling rate HOT 10
- msnoise test fails even all the requirements are satisfied | Ubuntu 20, Python 2.7 and 3.7 (tested with both) HOT 10
- Stretching always erases previous results HOT 3
- NEW JOB HOT 2
- SCAN DATA HOT 1
- msnoise test error HOT 3
- msnoise plot distance with velocity line HOT 1
- remove dupplicates mysql
- pairs definition should be more tolerant
- Stretching fails when dtt_lag='dynamic'
- Possible issue with mwcs_step HOT 1
- Strange whitening behaviour for ACs
- Compatibility with latest SciPy - SciPy 1.9.0 removed scipy.signal.hanning HOT 2
- Improving move2obpsy.whiten2 (when fft is zero leading to NaNs) HOT 3
- ModuleNotFoundError: No module named 'scipy.fftpack._fftpack HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msnoise.