Giter VIP home page Giter VIP logo

py2lispidyom's People

Contributors

faroit avatar hackmd-deploy avatar hayesall avatar xinyiguan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

py2lispidyom's Issues

Code coverage estimates: clarify what it should be

Code coverage appears to be ~59% (including some cases where tests fail on my machine)

Name                                                                       Stmts   Miss  Cover
----------------------------------------------------------------------------------------------
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/__init__.py            4      0   100%
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/configuration.py     434     71    84%
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/export.py             95     32    66%
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/extract.py           138     45    67%
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/run.py                62     16    74%
/home/hayesall/Review/py2lispIDyOM/py2lispIDyOM/viz.py               321    269    16%
----------------------------------------------------------------------------------------------
TOTAL                                                                       1054    433    59%

Recommendation: I don't have a hard rule for what coverage should be. I'd recommend clarifying what coverage threshold matters to the project in the contributing guidelines. A good portion of the library involves visualization, which tends to be slightly harder to test in my experience.

Modifications in `experiment_history` files after working through tutorials

After working through the Jupyter notebooks, my local git directory listed a large number of files as having been modified:

modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_csv/chor-005.csv
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_csv/chor-006.csv
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor001_cpitch.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor001_melody_name.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor001_onset.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor002_cpitch.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor002_melody_name.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/chor002_onset.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/entropy.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/information_content.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/outputs_in_mat/melody_name.mat
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/entropy_plots/chor-006.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/pianoroll_groundtruth_surprisal/chor-001.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/pianoroll_groundtruth_surprisal/chor-002.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/pianoroll_pitch_prediction_groundtruth/chor-003.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/pianoroll_pitch_prediction_groundtruth/chor-010.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/selected_surprisal_entropy/chor-003.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/simple_plot_information.content/chor-001.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/simple_plot_information.content/chor-002.png
modified:   tutorials/experiment_history/21-05-22_17.05.05/plots/surprisals_plots/chor-005.png

It looks like they are not being reproduced exactly.

Recommendation: Clarify whether these should be reproduced exactly, update copies on remote branch, or add some of these files to a .gitignore

Reproducing

cd tutorials/
head -n 2 experiment_history/21-05-22_17.05.05/outputs_in_csv/chor-005.csv

(Run through the notebooks)

The previous version showed:

dataset.id      ,melody.id,note.id,melody.name   ,vertint12,articulation,comma,voice,ornament,dyn,phrase,bioi,deltast,accidental,mpitch,cpitch,barlength,pulses,tempo   ,mode,keysig,dur ,onset,cpitch.order.ltm.cpitch,cpitch.order.stm.cpitch,cpitch.weight.ltm,cpitch.weight.stm,cpitch.weight.ltm.cpitch,cpitch.weight.stm.cpitch,cpitch.probability,cpitch.information.content,cpitch.entropy,cpitch.55    ,cpitch.57    ,cpitch.58    ,cpitch.59    ,cpitch.60    ,cpitch.62    ,cpitch.63    ,cpitch.64    ,cpitch.65    ,cpitch.66    ,cpitch.67    ,cpitch.68    ,cpitch.69  ,cpitch.70    ,cpitch.71  ,cpitch.72  ,cpitch.73    ,cpitch.74  ,cpitch.75    ,cpitch.76  ,cpitch.77    ,cpitch.78    ,cpitch.79    ,cpitch.81    ,cpitch.82    ,cpitch.83    ,cpitch.84    ,cpitch.85    ,cpitch.86    ,cpitch.88    ,onset.order.ltm.onset,onset.order.stm.onset,onset.weight.ltm,onset.weight.stm,onset.weight.ltm.onset,onset.weight.stm.onset,onset.probability,onset.information.content,onset.entropy,onset.0    ,onset.3     ,onset.6     ,onset.9     ,onset.12   ,onset.18    ,onset.24   ,onset.36    ,onset.48    ,onset.72    ,onset.120   ,probability ,information.content,entropy  ,information.gain
66052122170523.0,5.0      ,1.0    ,"""chor-005""",NA       ,0.0         ,0.0  ,1.0  ,0.0     ,NA ,0.0   ,0.0 ,0.0    ,NA        ,NA    ,72.0  ,96.0     ,4.0   ,600000.0,NA  ,NA    ,24.0,0.0  ,0.0                    ,0.0                    ,0.55405396       ,0.445946         ,1.0                     ,1.0                     ,0.041816834       ,4.5797725                 ,4.8619256     ,0.02490338   ,0.02490338   ,0.025781138  ,0.02490338   ,0.028281277  ,0.029853348  ,0.025781138  ,0.034215137  ,0.028281277  ,0.027468303  ,0.043547735  ,0.023999978  ,0.04467151 ,0.027468303  ,0.044112504,0.041816834,0.026635475  ,0.043547735,0.025781138  ,0.052472092,0.03489898   ,0.036888853  ,0.03879583   ,0.049981304  ,0.029075868  ,0.04738632   ,0.025781138  ,0.029075868  ,0.030614864  ,0.029075868  ,0.0                  ,0.0                  ,0.648152        ,0.351848        ,0.99999994            ,1.0                   ,0.13584055       ,2.880014                 ,3.3046489    ,0.13584055 ,0.03393319  ,0.03393319  ,0.03393319  ,0.10838893 ,0.069162674 ,0.10838893 ,0.089950934 ,0.13060634  ,0.13060634  ,0.12525566  ,0.005680422 ,7.459786           ,8.166577 ,NA

... and after re-running, they show:

dataset.id,melody.id,note.id,melody.name,vertint12,articulation,comma,voice,ornament,dyn,phrase,bioi,deltast,accidental,mpitch,cpitch,barlength,pulses,tempo,mode,keysig,dur,onset,cpitch.order.ltm.cpitch,cpitch.order.stm.cpitch,cpitch.weight.ltm,cpitch.weight.stm,cpitch.weight.ltm.cpitch,cpitch.weight.stm.cpitch,cpitch.probability,cpitch.information.content,cpitch.entropy,cpitch.55,cpitch.57,cpitch.58,cpitch.59,cpitch.60,cpitch.62,cpitch.63,cpitch.64,cpitch.65,cpitch.66,cpitch.67,cpitch.68,cpitch.69,cpitch.70,cpitch.71,cpitch.72,cpitch.73,cpitch.74,cpitch.75,cpitch.76,cpitch.77,cpitch.78,cpitch.79,cpitch.81,cpitch.82,cpitch.83,cpitch.84,cpitch.85,cpitch.86,cpitch.88,onset.order.ltm.onset,onset.order.stm.onset,onset.weight.ltm,onset.weight.stm,onset.weight.ltm.onset,onset.weight.stm.onset,onset.probability,onset.information.content,onset.entropy,onset.0,onset.3,onset.6,onset.9,onset.12,onset.18,onset.24,onset.36,onset.48,onset.72,onset.120,probability,information.content,entropy,information.gain
66052122170523.0,5.0,1.0,"""chor-005""",NA,0.0,0.0,1.0,0.0,NA,0.0,0.0,0.0,NA,NA,72.0,96.0,4.0,600000.0,NA,NA,24.0,0.0,0.0,0.0,0.55405396,0.445946,1.0,1.0,0.041816834,4.5797725,4.8619256,0.02490338,0.02490338,0.025781138,0.02490338,0.028281277,0.029853348,0.025781138,0.034215137,0.028281277,0.027468303,0.043547735,0.023999978,0.04467151,0.027468303,0.044112504,0.041816834,0.026635475,0.043547735,0.025781138,0.052472092,0.03489898,0.036888853,0.03879583,0.049981304,0.029075868,0.04738632,0.025781138,0.029075868,0.030614864,0.029075868,0.0,0.0,0.648152,0.351848,0.99999994,1.0,0.13584055,2.880014,3.3046489,0.13584055,0.03393319,0.03393319,0.03393319,0.10838893,0.069162674,0.10838893,0.089950934,0.13060634,0.13060634,0.12525566,0.005680422,7.459786,8.166577,NA

Automating the installation step

The installation is pretty tricky at the moment, following from the idyom installation instructions.

Recommmendation: Figure out how to automate installation on a common platform (e.g. Ubuntu).

sbcl

This one should be pretty straightforward:

curl -L http://prdownloads.sourceforge.net/sbcl/sbcl-2.2.9-x86-64-linux-binary.tar.bz2 > sbcl-2.2.9-x86-64-linux-binary.tar.bz2
bzip2 -cd sbcl-2.2.9-x86-64-linux-binary.tar.bz2 | tar xvf -
cd sbcl-2.2.9-x86-linux
sudo sh install.sh

quicklisp

This one might be trickier. The quicklisp installation instructions currently suggest installing in interactive mode.

I didn't test it yet (I'm less familiar with sbcl), but using --eval might be one path to follow here:

sbcl --eval '(quicklisp-quickstart:install)'

sqlite3

This one should be easy.

sudo apt install sqlite3

IDyOM

This one feels fairly straightforward after figuring out the username (whoami), and evaluating a few expressions to make sure packages are correctly downloaded.

Here is a rough draft for the fourth step:

echo '(ql:quickload "clsql")' >> .sbclrc
echo '(defun start-idyom ()' >> .sbclrc
echo "  (defvar *idyom-root* \"/home/$(whoami)/idyom/\")" >> .sbclrc
echo "  (ql:quickload \"idyom\")" >> .sbclrc
echo "  (clsql:connect '(\"/home/$(whoami)/idyom/db/database.sqlite\") :if-exists :old :database-type :sqlite3))" >> .sbclrc

JOSS Reviewer Comments - AH

Hello @xinyiguan,

I'll be updating this issue here with respect to review: #4738. Most of my comments will be suggestions and so can be discussed. If anything is a major issue, I will make it clear 😊

  • Authors, have you made clear anywhere the contributions of the other two authors? I cannot see them listed in git commits
  • Would it help for install instructions to note that dependancies such as SBCL can be installed via brew install sbcl or, I assume, linux package mangers? - this might just help you to make an install guide fit onto your repo without directing people around (could even make an install script for users?).
  • Is there overlap in this project and something like: https://github.com/GuiMarion/IDyOMpy which seems to e a re-implementation? If so, perhaps it would be good to comment on this in the paper and cite?

Please note: I will let you know when I've finished adding thoughts

How to run the unit tests?

The .github/workflows/tests.yml file appears to suggest a "Test with pytest" step using the following:

pytest --cov=py2lispIDyOM --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml

Recommendation: Clarify how tests work, and enforce this by running tests on pushes and pull requests (see #5)

Case 1

On the current master branch, the tutorial notebooks work correctly. However, running this command from the base of the repository produces:

---------- coverage: platform linux, python 3.9.13-final-0 -----------
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

========================================================================================= short test summary info =========================================================================================
FAILED tests/test_export.py::TestExport::test_csv_file_check - IndexError: list index out of range
FAILED tests/test_export.py::TestExport::test_export_csv_files - IndexError: list index out of range
FAILED tests/test_export.py::TestExport::test_export_mat_files - IndexError: list index out of range
FAILED tests/test_export.py::TestExport::test_mat_file_check - IndexError: list index out of range
FAILED tests/test_extract.py::TestExtract::test_experimentinfo_extract - IndexError: list index out of range
FAILED tests/test_extract.py::TestExtract::test_melodyinfo_extract - IndexError: list index out of range
FAILED tests/test_run.py::TestIDyOMExperiment::test_case_1 - FileExistsError: [Errno 17] File exists: 'experiment_history/TestCase1/'
FAILED tests/test_run.py::TestIDyOMExperiment::test_case_2 - AssertionError: test_dataset folder is empty!

Case 2

Running this command after switching to the tests/ directory:

cd tests/
pytest --cov=py2lispIDyOM --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml

results in one failed test:

---------- coverage: platform linux, python 3.9.13-final-0 -----------
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

========================================================================================= short test summary info =========================================================================================
FAILED test_run.py::TestIDyOMExperiment::test_case_1 - FileExistsError: [Errno 17] File exists: 'experiment_history/TestCase1/'

some questions about 'my_experiment.run ()'

Hello @xinyiguan
Thanks for your helpful project!
However, some music can’t be counted when project run to β€˜my_experiment.run ()’.
Error messages were attached to the question, and look forward to your answer~

** running lisp script **
To load "clsql":
Load 1 ASDF system:
clsql
; Loading "clsql"

To load "idyom":
Load 1 ASDF system:
idyom
; Loading "idyom"
..........

Inserting data into database: dataset 66022123143047.
Inserting data into database: dataset 99022123143047.
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [REPLACE-FUNCTION] Call a different function with the same arguments
1: [CALL-FORM ] Call a different form
2: [RETRY ] Retry EVAL of current toplevel form.
3: [CONTINUE ] Ignore error and continue loading file "/Users/yousiqi/Downloads/install_idyom/experiment_history/21-02-23_14.30.43/compute.lisp".
4: [ABORT ] Abort loading file "/Users/yousiqi/Downloads/install_idyom/experiment_history/21-02-23_14.30.43/compute.lisp".
5: Ignore runtime option --load "experiment_history/21-02-23_14.30.43/compute.lisp".
6: Skip rest of --eval and --load options.
7: Skip to toplevel READ/EVAL/PRINT loop.
8: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).

(MAX) [external]
0]
*
** Finished! **
While evaluating the form starting at line 4, column 0
of #P"/Users/yousiqi/Downloads/install_idyom/experiment_history/21-02-23_14.30.43/compute.lisp":

debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR @52AD7DB4 in thread
#<THREAD "main thread" RUNNING {1001080003}>:
invalid number of arguments: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.