Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_digital_image_processing -> test_local_binary_pattern replacing a large image with a smaller one #10161

Merged
merged 10 commits into from
Oct 9, 2023

Conversation

quant12345
Copy link
Contributor

@quant12345 quant12345 commented Oct 9, 2023

Describe your change:

Replaced lena.jpg with lena_small.jpg to make tests faster.

pull request 10161 before:

file_path = "digital_image_processing/image_data/lena.jpg"

after:

file_path = "digital_image_processing/image_data/lena_small.jpg"

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 9, 2023
@cclauss
Copy link
Member

cclauss commented Oct 9, 2023

It would be helpful if this pull request provided before and after times.

@@ -96,7 +96,7 @@ def test_nearest_neighbour(


def test_local_binary_pattern():
file_path = "digital_image_processing/image_data/lena.jpg"
file_path = "digital_image_processing/image_data/lena_small.jpg"
Copy link
Member

@cclauss cclauss Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

Suggested change
file_path = "digital_image_processing/image_data/lena_small.jpg"
from os import getenv # Speed up our Continuous Integration tests
file_name = "lena_small.jpg" if getenv("CI") else "lena.jpg"
file_path = f"digital_image_processing/image_data/{file_name}.jpg"

@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 9, 2023
tests fail, I'll try an empty commit

# Reading the image and converting it to grayscale.
file_name = "lena_small.jpg" if getenv("CI") else "lena.jpg"
file_path = f"digital_image_processing/image_data/{file_name}.jpg"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file_path = f"digital_image_processing/image_data/{file_name}.jpg"
file_path = f"digital_image_processing/image_data/{file_name}"

The build is failing because your filepath is "lena.jpg.jpg"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. :-(

@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 9, 2023
@algorithms-keeper algorithms-keeper bot added tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Oct 9, 2023
@cclauss cclauss enabled auto-merge (squash) October 9, 2023 15:16
@algorithms-keeper algorithms-keeper bot removed the awaiting reviews This PR is ready to be reviewed label Oct 9, 2023
@quant12345
Copy link
Contributor Author

@cclauss also added comments to the function itself: test_local_binary_pattern, indicating the pull request number and the values before and after.

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@cclauss cclauss disabled auto-merge October 9, 2023 15:45
@cclauss cclauss enabled auto-merge (squash) October 9, 2023 15:46
@cclauss cclauss merged commit ba828fe into TheAlgorithms:master Oct 9, 2023
3 checks passed
@quant12345 quant12345 deleted the tdip branch October 9, 2023 15:49
@tianyizheng02
Copy link
Contributor

Contributes to #9718 (adding for linking purposes)

sedatguzelsemme pushed a commit to sedatguzelsemme/Python that referenced this pull request Sep 15, 2024
…a large image with a smaller one (TheAlgorithms#10161)

* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6.

* Replaced lena.jpg with lena_small.jpg to make tests faster.

* Update digital_image_processing/test_digital_image_processing.py

Co-authored-by: Christian Clauss <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_digital_image_processing.py

tests fail, I'll try an empty commit

* Apply suggestions from code review

* Update test_digital_image_processing.py

added clarifications

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_digital_image_processing.py

---------

Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants