From 16e50938055c73a1f3d92344e1dfa28f03d6134e Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 11:47:05 -0400 Subject: [PATCH 01/10] added test model to do also --- pytorch_lightning/testing/lm_test_module.py | 2 +- tests/test_models.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pytorch_lightning/testing/lm_test_module.py b/pytorch_lightning/testing/lm_test_module.py index 8fe4cfc0e1..695b495fa3 100644 --- a/pytorch_lightning/testing/lm_test_module.py +++ b/pytorch_lightning/testing/lm_test_module.py @@ -232,7 +232,7 @@ class LightningTestModel(LightningModule): return self.__dataloader(train=False) @staticmethod - def add_model_specific_args(parent_parser, root_dir): + def add_model_specific_args(parent_parser, root_dir): # pragma: no cover """ Parameters you define here will be available to your model through self.hparams :param parent_parser: diff --git a/tests/test_models.py b/tests/test_models.py index f6e792fe81..ce1697a91e 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -681,10 +681,14 @@ def get_hparams(continue_training=False, hpc_exp_number=0): return hparams -def get_model(): +def get_model(use_test_model=False): # set up model with these hyperparams hparams = get_hparams() - model = LightningTemplateModel(hparams) + + if use_test_model: + model = LightningTestModel(hparams) + else: + model = LightningTemplateModel(hparams) return model, hparams From d5e609398c1ec7db329c97d1bd0e0db6daea4237 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 11:49:37 -0400 Subject: [PATCH 02/10] moved badge image --- coverage.svg => docs/source/_static/coverage.svg | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename coverage.svg => docs/source/_static/coverage.svg (100%) diff --git a/coverage.svg b/docs/source/_static/coverage.svg similarity index 100% rename from coverage.svg rename to docs/source/_static/coverage.svg From cb0ab9d212905a04e326e773392e80752da674dc Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 11:50:51 -0400 Subject: [PATCH 03/10] moved badge image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a93a73b8d..a6a40a5bd5 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ removed until windows install issues resolved. removed until codecov badge isn't empy. likely a config error showing nothing on master. [![codecov](https://codecov.io/gh/Borda/pytorch-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/Borda/pytorch-lightning) --> -[![Coverage](https://github.com/williamFalcon/pytorch-lightning/blob/master/coverage.svg)](https://github.com/williamFalcon/pytorch-lightning/tree/master/tests#running-coverage) +[![Coverage](https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/coverage.svg)](https://github.com/williamFalcon/pytorch-lightning/tree/master/tests#running-coverage) [![CodeFactor](https://www.codefactor.io/repository/github/borda/pytorch-lightning/badge)](https://www.codefactor.io/repository/github/borda/pytorch-lightning) [![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=latest)](https://pytorch-lightning.readthedocs.io/en/latest) [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/williamFalcon/pytorch-lightning/blob/master/LICENSE) From 075653e6ddde7db380acff986771bfcacbf91320 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:01:18 -0400 Subject: [PATCH 04/10] moved badge image --- .codecov.yml | 4 ++++ pytorch_lightning/testing/lm_test_module.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index f10c187329..40560393a2 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -40,3 +40,7 @@ comment: require_changes: false behavior: default # update if exists else create new # branches: * + +ignore: + - "pytorch_lightning/utilities/arg_parse.py" + - diff --git a/pytorch_lightning/testing/lm_test_module.py b/pytorch_lightning/testing/lm_test_module.py index 695b495fa3..453dc145e6 100644 --- a/pytorch_lightning/testing/lm_test_module.py +++ b/pytorch_lightning/testing/lm_test_module.py @@ -135,16 +135,16 @@ class LightningTestModel(LightningModule): val_acc = val_acc.unsqueeze(0) # alternate possible outputs to test - if self.trainer.batch_nb % 1 == 0: + if batch_i % 1 == 0: output = OrderedDict({ 'val_loss': loss_val, 'val_acc': val_acc, }) return output - if self.trainer.batch_nb % 2 == 0: + if batch_i % 2 == 0: return val_acc - if self.trainer.batch_nb % 3 == 0: + if batch_i % 3 == 0: output = OrderedDict({ 'val_loss': loss_val, 'val_acc': val_acc, From edcb5e97df5cb63f0b8549031ff5770d17d704f7 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:01:45 -0400 Subject: [PATCH 05/10] moved badge image --- .codecov.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index 40560393a2..94118c1322 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -43,4 +43,3 @@ comment: ignore: - "pytorch_lightning/utilities/arg_parse.py" - - From 1d1c89f495173ff2efe56a3c20c48dd5c4bdfce1 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:14:31 -0400 Subject: [PATCH 06/10] moved badge image --- .codecov.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 94118c1322..45a8a36126 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -24,6 +24,9 @@ coverage: target: 40% # specify the target "X%" coverage to hit # threshold: 50% # allow this much decrease on patch changes: false + ignore: + - "pytorch_lightning/utilities/arg_parse.py" + - "raise *" parsers: gcov: @@ -41,5 +44,4 @@ comment: behavior: default # update if exists else create new # branches: * -ignore: - - "pytorch_lightning/utilities/arg_parse.py" + From c043862a559daffde3549217b54c8f687e33ed4b Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:27:52 -0400 Subject: [PATCH 07/10] moved badge image --- .codecov.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 45a8a36126..8c68df67ea 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -24,9 +24,10 @@ coverage: target: 40% # specify the target "X%" coverage to hit # threshold: 50% # allow this much decrease on patch changes: false - ignore: - - "pytorch_lightning/utilities/arg_parse.py" - - "raise *" + +ignore: + - "pytorch_lightning/utilities/arg_parse.py" + - "raise *" parsers: gcov: From 0985a1875c3c8d2d76a011bd81c9f60f9d06f6e0 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:42:36 -0400 Subject: [PATCH 08/10] last config try --- .codecov.yml | 4 ---- setup.cfg | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 8c68df67ea..b677f04b1e 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -25,10 +25,6 @@ coverage: # threshold: 50% # allow this much decrease on patch changes: false -ignore: - - "pytorch_lightning/utilities/arg_parse.py" - - "raise *" - parsers: gcov: branch_detection: diff --git a/setup.cfg b/setup.cfg index 5b21c68321..9e723aad9c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,6 +31,7 @@ exclude_lines = print(traceback.print_exc()) return * raise Exception + raise * warnings print raise RuntimeError @@ -42,6 +43,7 @@ omit = pytorch_lightning/callbacks/pt_callbacks.py tests/test_models.py pytorch_lightning/testing_models/lm_test_module.py + pytorch_lightning/utilities/arg_parse.py [flake8] ignore = E731,W504,F401,F841 From 5785e5965d99cbf28f729a22dbe84195be76bdfa Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 7 Aug 2019 12:51:52 -0400 Subject: [PATCH 09/10] last config try --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 9e723aad9c..28be637482 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,7 @@ exclude_lines = return * raise Exception raise * + except * warnings print raise RuntimeError From 8c41bfe26758365807490129d555d34d8bd36489 Mon Sep 17 00:00:00 2001 From: williamFalcon Date: Wed, 7 Aug 2019 10:03:28 -0700 Subject: [PATCH 10/10] moved badge --- docs/source/_static/coverage.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/_static/coverage.svg b/docs/source/_static/coverage.svg index ee07d4c27b..6bfc8faf24 100644 --- a/docs/source/_static/coverage.svg +++ b/docs/source/_static/coverage.svg @@ -15,7 +15,7 @@ coverage coverage - 96% - 96% + 99% + 99%