kaanaksit / odak

Scientific computing library for optics, computer graphics and visual perception.
https://kaanaksit.com/odak
Mozilla Public License 2.0
177 stars 52 forks source link

Test Output Directory and .gitignore Configuration #96

Closed David-Morales-Norato closed 5 months ago

David-Morales-Norato commented 5 months ago

Hello,

First, I would like to express my gratitude for this amazing library.

I am preparing a pull request for Odak and encountered an issue when running tests. A significant number of files are generated in the main folder, which clutters the directory.

Proposed Solution:

  1. Test Output Directory: Implement a standard practice where each test saves its results in a designated subfolder within the test directory.
  2. Ignore Configuration: Ensure that this subfolder is included in the .gitignore file to prevent undesired files from being included in commits.

Additional Information:

For reference, I have attached the git status output after cloning the main branch and running pytest.

Thank you for considering this enhancement; it will improve the organization of the project. I believe I could refactor the tests, but it will take me some time, and first I want to make a pull request about something else.

Best regards,

David Morales-Norato

On branch light_asm_fresnel_light_propagators
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    Impulse_Response_Fresnel.png
    Transfer_Function_Fresnel.png
    heights.ply
    hologram_intensity.png
    image.png
    image0_cropped.png
    image0_padded.png
    image1_padded.png
    image_0000.png
    image_16_bit_color.png
    image_16_bit_monochrome.png
    image_8_bit_color.png
    image_8_bit_monochrome.png
    image_intensity.png
    out.ply
    output.ply
    output_amplitude.png
    output_amplitude_0.png
    output_amplitude_1.png
    output_hologram.png
    phase.png
    reconstruction.png
    reconstruction_image_000.png
    reconstruction_image_001.png
    reconstruction_image_002.png
    status.txt
    target.png
    targets_0000.png
    test/heights.pt

nothing added to commit but untracked files present (use "git add" to track)
kaanaksit commented 5 months ago

I have updated the unit tests accordingly. Now, the unit tests are all writing to the same directory with a slightly better naming convention. Moving on forward, the results will be stored at test_output directory. The changes will be reflected to the upcoming odak==0.2.6 and if you use the repository for installing, you should have the changes incorporated already.

I am closing this issue as the necessary commits are in the repository. Please do not hesitate to revive it if needed in the future.