diff --git a/.codecov.yml b/.codecov.yml index f10c187329..b677f04b1e 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -40,3 +40,5 @@ comment: require_changes: false behavior: default # update if exists else create new # branches: * + + 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) diff --git a/coverage.svg b/docs/source/_static/coverage.svg similarity index 88% rename from coverage.svg rename to docs/source/_static/coverage.svg index ee07d4c27b..6bfc8faf24 100644 --- a/coverage.svg +++ b/docs/source/_static/coverage.svg @@ -15,7 +15,7 @@ coverage coverage - 96% - 96% + 99% + 99% diff --git a/pytorch_lightning/testing/lm_test_module.py b/pytorch_lightning/testing/lm_test_module.py index 8fe4cfc0e1..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, @@ -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/setup.cfg b/setup.cfg index 5b21c68321..28be637482 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,6 +31,8 @@ exclude_lines = print(traceback.print_exc()) return * raise Exception + raise * + except * warnings print raise RuntimeError @@ -42,6 +44,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 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