# Welcome to codecheck Delft 2024-05
We will use this notepad for collaborative editing. Everyone (and I mean everyone) should be able to read and write so please treat accordingly!
This document:
https://tinyurl.com/delft2024-05
[CODECHECK paper](https://f1000research.com/articles/10-253)
[Slides from Stephen](https://tinyurl.com/codecheck2024-02)
# Discussion points for the final session
- what if all or part of the data cannot be made publicly available because of privacy and/or licensing issues?
- what are incentives for codecheckers to invest their time?
# Example papers to codecheck
## Filip
State-dependent dynamic tube MPC: A novel tube MPC method with a fuzzy model of disturbances
[Paper](http://arxiv.org/abs/2310.19997)
[Code](https://data.4tu.nl/datasets/3f1b28ee-2eca-4bac-bc2e-5ae2d2db4a5f)
Figure 11 --> [now in codecheck.yml!]
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
## Ilaria
[Code](https://github.com/IlariaFichera/Inter_Noise2024_Codes_Acoustics_Diffusion_Equation)
[Paper](https://github.com/IlariaFichera/Inter_Noise2024_Codes_Acoustics_Diffusion_Equation/blob/main/Inter_Noise2024_Paper.pdf)
### Suggestions:
- Have the initial variables in the code matching to the Ream me to make it run
- Have a default file in the folder to not do the "copy data" process
- in "DiffEq3DFunction.py" comment out all the figures to not have them opening all the time
- in the matlab code, include "close all" and "clear" at the start
### Problems:
- When the Receiver position and the Source Position are equal, an error occures after the first Picture
- Path not found on mac ("/" used, needs "\") -> use "\\" to make it workos.path
- use os.path to make it work with other setups
- Fix the path in the matlab code -> use [addpath](https://de.mathworks.com/help/matlab/ref/addpath.html)
- I got an error in Matlab running the file A_ComparisonRadiosityDiffusionAfterOpt.m with an error on the readNPY function. I don't have this function available.
- You have to install [This](https://github.com/kwikteam/npy-matlab), as written in the readme
- I think its a good Idea to highlight a bit more that this is for matlab and not for python
### Results:
- Figure 2
- a -> Matlab A, Figure 1
- b -> Matlab A, Figure 2
- Figure 3
- a
- b
- c
- Figure 4
- a
- b
- c
- Figure 5
- a -> Matlab A, Figure 1
- b -> Matlab A, Figure 3
- c -> Matlab A, Figure 4
- Figure 6 -> Matlab B, Figure 1
- Figure 7
- a
- b
- c
- Figure 8 -> Matlab B, Figure 2
- The other figures need to be rerun with different parameters
## Nestor
[Code](https://github.com/delapazruiz/domestic.wastewater.variability)
[Paper](https://doi.org/10.1016/j.jenvman.2023.119680)
### Notes on reproducing the results on Windows
(Without using the docker images)
NetLogo asks to install 'time', which I did.
To speed up the calculation, uncheck the checkboxes that trigger gui updates before pressing run in the 'run' dialog in NetLogo.
Running the first model took about 10 minutes on my 2024 Dell laptop.
Running the second model also took about 10 minutes on my 2024 Dell laptop.
When 'knitting' the Rmd file,
R Studio asks to install additional packages, which I did.
Additionally, I needed to install the following packages:
- lubridate
- hrbrthemes
- highfrequency
- readr
- BayesFactor
- ggstatsplot
- here
However, this requires me to first install Rtools, which I did.
I was using:
- RStudio version 2024.04.1 Build 748.
- R 4.4.0
figure 5 a & b in the generated report: Corresponding to figure 5 a & b in the paper.
The table below figure 5 in the paper is a combination of the data below figure 5 a & b in the results.
Figure 6 in the generated report corresponds to figure 6 in the paper.
Table 2 in the generated report corresponds to table 2 in the paper.
### Mac
First and foremost: getting NetLogo to work on Mac was a pain :sweat_smile:. These are the steps to get it to work (tested on macOS Monterey 12.7.4):
- Download NetLogo for Mac from [their website](https://ccl.northwestern.edu/netlogo/6.1.1/).
- Move the NetLogo 6.1.1 folder (i.e., entire contents from the .dmg file) to the Applications folder on your Mac.
- Then, perform the following steps around 20 times:
- Right click NetLogo 6.1.1.app in the Netlogo 6.1.1 folder.
- Click open.
- A prompt shows up with either 2 buttons (*Move to Bin*, *Cancel*) or 3 buttons (the same 2 as before + *Open*).
- In the case of 3 buttons, click *Open*.
- In the case of 2 buttons (possibly repeat this a few times):
- Click *Cancel*
- In the Security & Privacy settings, General tab, click *allow anyway*.
- At some point the NetLogo application opens, but not fully. If the NetLogo application does not close by itself (for example, if the NetLogo banner appears but nothing else happens), manually close the application and continue to repeat the steps above.
- If NetLogo shows an error message, click *Don't show again*.
- Repeat the above process until NetLogo can be opened without any warning prompts.
*Mac-specific instructions for changing the NetLogo.cfg file*
- Right-click NetLogo 6.1.1.app, and select *Show Package Contents*
- Navigate to Contents/Java and open NetLogo.cfg in a texteditor.
- Change line 17 (`-Xmx1024m`) to `-Xmx20024m` to increase the memory.
### Running the Quick reproducibility code
Feedback
- I required some additional help from Nestor to get the simulation to run as there were a few steps missing from the readme file.
- For example, I needed to uncheck all boxes in the Run Options popup, and change the number of Simulation runs in parallel to the number of processors in my machine (8).
- Furthermore, I needed to wait for the "Running Experiment" popup to show before trying to do anyting else.
- Finally, I needed to change the slider to 'faster' to make the simulation run faster.
- It might also be nice to mention in the readme that to validate that the simulation is running correctly, the user can navigate to the results folder and see if the .csv files are changing size.
## Martin
[Code](https://github.com/msmathcomp/hyperbolic-tsne)
[Paper](https://arxiv.org/abs/2401.13708)
### Docker version
- Missing statement that first the repository needs to be downloaded from github
- Should be clear that you need to go into the directory before building the docker container
- Error in building docker file: There seems to be a problem while installing the requirements.txt in one of the sub packages, cause some requirements are installed correctly.
```shell=
26.48 Failed to build h5py
26.48 error: subprocess-exited-with-error
26.48
26.48 × Building wheel for h5py (pyproject.toml) did not run successfully.
26.48 │ exit code: 1
26.48 ╰─> [73 lines of output]
26.48 running bdist_wheel
26.48 running build
26.48 running build_py
26.48 creating build
26.48 creating build/lib.linux-aarch64-cpython-39
26.48 creating build/lib.linux-aarch64-cpython-39/h5py
26.48 copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-cpython-39/h5py
26.48 copying h5py/version.py -> build/lib.linux-aarch64-cpython-39/h5py
26.48 copying h5py/__init__.py -> build/lib.linux-aarch64-cpython-39/h5py
26.48 copying h5py/ipy_completer.py -> build/lib.linux-aarch64-cpython-39/h5py
```
A fix was found by adding "conda run -n htsne conda install h5py" before the requirements line in the docker file.
```shell=
RUN conda create -y -n htsne python=3.9.16
RUN conda run -n htsne conda install h5py # fix
RUN conda run -n htsne pip install -r requirements.txt
```
- There are no instructions stating that the repository needs to be cloned before running docker.
- User needs to go into the directory before running the docker command.
- There is a problem on Mac installing one of the packages, this results in problems in the h5py sub requirements. This can be resolved by installing it outside of the requirements.txt file using the conda environment.
- It would be convenient to say how to get the docker running after the build. `docker run -it hyperbolic-tsne`
- There are no instructions on how to get the data into the container to actually run the code and reproduce the paper. A solution would be to include/set-up a volume so that the dataset can go inside the container
- People can not run the jupyter notebook from within the docker container
-
### Mac
- Getting NetLogo to work was a pain. I think I needed to perform the following steps around 20 times.
- Right click NetLogo 6.1.1.app
- Open
- A prompt shows up with either 2 buttons (*Eject Disc Image*, *Cancel*) or 3 buttons (the 2 as before + *Open*).
- In the case of 3 buttons, click *Open*.
- In the case of 2 buttons (possibly repeat this a few time):
- Click *Cancel*
- In the Security & Privacy settings, General tab, click allow anyway.
- If the NetLogo loading screen appears but nothing else happens, close NetLogo again and repeat the steps above.
- If an error message shows click *Don't show again*.
- Repeat the process until NetLogo can be opened without any prompts.
### Anaconda
Got ```pip install error: RuntimeError: Unsupported compiler -- at least C++11 support is needed```.
Solution: ```apt install build-essentials```
NOTE: Add this step in README between 3rd and 4th step.
Only Figure 12 is replicated.
It is unclear from LUKK page which files to download
How to download MYELOID8000 is also unclear
example_different_params.py is missing
Modification needed: The algorithm should run ONLY on the available datasets
MNIST link broke: https://yann.lecun.com/exdb/mnist/