Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

simplify examples #57

Merged
merged 8 commits into from
Feb 3, 2021
Merged

simplify examples #57

merged 8 commits into from
Feb 3, 2021

Conversation

Borda
Copy link
Member

@Borda Borda commented Feb 2, 2021

What does this PR do?

since we do not run tests on examples anyway there is o reason to have them wrap in main especially since there is nothing else than main anyway...

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@Borda Borda added the documentation Improvements or additions to documentation label Feb 2, 2021
@Borda Borda enabled auto-merge (squash) February 2, 2021 20:42
@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #57 (0440d0e) into master (c6725fe) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   80.31%   80.37%   +0.05%     
==========================================
  Files          47       47              
  Lines        1387     1391       +4     
==========================================
+ Hits         1114     1118       +4     
  Misses        273      273              
Flag Coverage Δ
unittests 80.37% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/core/data/datamodule.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6725fe...513c951. Read the comment docs.

@carmocca
Copy link
Contributor

carmocca commented Feb 2, 2021

I believe the examples hang with num_workers > 0 on some platforms (namely MacOS) if this is removed

@Borda
Copy link
Member Author

Borda commented Feb 2, 2021

I believe the examples hang with num_workers > 0 on some platforms (namely MacOS) if this is removed

not really, they are not even called anywhere :D
https://github.com/PyTorchLightning/lightning-flash/blob/3c5b535ce26a12fd141acff7e20bc2b18ee56a0a/.github/workflows/ci-testing.yml#L80
and as you can see all test passed :]

@carmocca
Copy link
Contributor

carmocca commented Feb 2, 2021

@Borda
Copy link
Member Author

Borda commented Feb 2, 2021

We do test some of them:

yes but here you test just some of them and the execution is called from tests folder
the wrap in if/main is typical if you want to call test on flash_examples as a folder and skip some code...
which is not the case, right?

@teddykoker
Copy link
Contributor

if/main is needed in order for the dataloaders to function properly (because of multiprocessing)

@Borda
Copy link
Member Author

Borda commented Feb 2, 2021

if/main is needed in order for the dataloaders to function properly (because of multiprocessing)

so the script is called in a subprocess, but it does not have if/main it is empty so when/how it is called?
but here all tests are passing so what test are/were hanging?

@carmocca
Copy link
Contributor

carmocca commented Feb 2, 2021

@pep8speaks
Copy link

pep8speaks commented Feb 2, 2021

Hello @Borda! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-02-03 08:11:10 UTC

@Borda
Copy link
Member Author

Borda commented Feb 2, 2021

As I said, try uncommenting

trying now, but as it is, you preventing the hanging n two fronts - in examples and restricting workers to 0

@Borda
Copy link
Member Author

Borda commented Feb 3, 2021

@carmocca seems to be fine, no hanging...

@carmocca
Copy link
Contributor

carmocca commented Feb 3, 2021

The failing MacOS tests seem to show otherwise 😆

@Borda
Copy link
Member Author

Borda commented Feb 3, 2021

As I said, try uncommenting

trying now, but as it is, you preventing the hanging n two fronts - in examples and restricting workers to 0

let's see if the updated nb workers pass on the master - https://github.com/PyTorchLightning/lightning-flash/actions/runs/532388784

@carmocca
Copy link
Contributor

carmocca commented Feb 3, 2021

I'm not sure about what are you trying to say.

But you just removed both fronts.

And in any case, we cant fix num_workers 0 forever. So that's why the examples require if __name__: __main__

@Borda
Copy link
Member Author

Borda commented Feb 3, 2021

But you just removed both fronts.

Because you asked for it, so I am returning to workers count 0
so I suggest editing code such that for Linux/win use max nb workers and 0 for mac (anyway there won't be any super multi-core CPU used in Mac machines, right?)

@Borda Borda disabled auto-merge February 3, 2021 08:55
@Borda Borda merged commit 5657439 into master Feb 3, 2021
@Borda Borda deleted the examples branch February 3, 2021 08:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants