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

Optimized functions for speed and documentation changes #542

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ajinkya-kulkarni
Copy link

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

  • Fixes:

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Copy link
Member

@ernestoarbitrio ernestoarbitrio left a comment

Choose a reason for hiding this comment

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

Hi @ajinkya-kulkarni
Thank you so much for your contribution ❤️ we appreciate it 😄

I left a couple of minor comments, plus a concern about a missing object reference. Could you please address?

Thanks

histolab/util.py Show resolved Hide resolved
histolab/util.py Show resolved Hide resolved
histolab/util.py Show resolved Hide resolved
histolab/util.py Outdated
@@ -38,25 +38,24 @@ def apply_mask_image(img: PIL.Image.Image, mask: np.ndarray) -> PIL.Image.Image:
Parameters
----------
img : PIL.Image.Image
Input image
Input image
Copy link
Member

Choose a reason for hiding this comment

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

could you explain the rationale of all this whitespaces added in the whole module? Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

same, the numpy docstring style document uses 1 tab / 4 spaces of indentation for the description with respect to the parameter name

Copy link
Author

@ajinkya-kulkarni ajinkya-kulkarni left a comment

Choose a reason for hiding this comment

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

Hopefully fixed the import problem

Copy link
Member

@ernestoarbitrio ernestoarbitrio left a comment

Choose a reason for hiding this comment

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

I'm seeing that:

histolab/util.py:138:89: E501 line too long (91 > 88 characters)
histolab/util.py:157:89: E501 line too long (95 > 88 characters)
histolab/util.py:317:89: E501 line too long (90 > 88 characters)

I'd suggest to use pre-commit to avoid this problems in the commits. Please read the contribution guidelines

Comment on lines +360 to +366
class Obj(object):

@lazyproperty
def fget(self):
return 'some result'
@lazyproperty
def fget(self):
return 'some result'

obj = Obj()
obj = Obj()
Copy link
Member

Choose a reason for hiding this comment

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

each new commit is adding further spaces. Could you please check what's the problem?

Copy link
Author

Choose a reason for hiding this comment

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

Hmm, strange. Let me look into it. Might be an issue with the code editor I use

Copy link
Member

Choose a reason for hiding this comment

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

It could be 😄 thanks ❤️

@ernestoarbitrio
Copy link
Member

HI @ajinkya-kulkarni
I've noticed that a bunch of tests are now failing after your utils.py improvement. Did you run the test suite locally on your computer? All that failures should not exist if the utils.py has been refactored / improved in terms of performance.
Did you have the change to understand the nature of those test failures?
In case you need to discuss with us join our slack channel. See README for ref :D
👋

@ajinkya-kulkarni
Copy link
Author

No, I didnt run the tests locally. I'll have a look, thanks!

@alessiamarcolini alessiamarcolini deleted the branch histolab:main August 17, 2023 09:04
@alessiamarcolini alessiamarcolini changed the base branch from master to main August 17, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants