diff --git a/unitgrade/__pycache__/unitgrade.cpython-38.pyc b/unitgrade/__pycache__/unitgrade.cpython-38.pyc index bd16532967d3b50cf89e3923950e92ac07aa25fe..79d28c2c207464f86831a1a24c58a1908f9fbb16 100644 Binary files a/unitgrade/__pycache__/unitgrade.cpython-38.pyc and b/unitgrade/__pycache__/unitgrade.cpython-38.pyc differ diff --git a/unitgrade/__pycache__/unitgrade_helpers.cpython-38.pyc b/unitgrade/__pycache__/unitgrade_helpers.cpython-38.pyc index 8a97ab0838eea34ae10999be8ca134838931f8aa..bed82f87d21feaedd5ccb707a1ea1b71a1d99ad4 100644 Binary files a/unitgrade/__pycache__/unitgrade_helpers.cpython-38.pyc and b/unitgrade/__pycache__/unitgrade_helpers.cpython-38.pyc differ diff --git a/unitgrade/__pycache__/version.cpython-38.pyc b/unitgrade/__pycache__/version.cpython-38.pyc index 57989453481719d2c5051bcb147d601d4104e23f..8dc5bac8678643c646bd1057bdfb5299c1e65b24 100644 Binary files a/unitgrade/__pycache__/version.cpython-38.pyc and b/unitgrade/__pycache__/version.cpython-38.pyc differ diff --git a/unitgrade/unitgrade.py b/unitgrade/unitgrade.py index 9bbd6e31e56c0b3301cfccd7b69cd74842d86d0c..d4f69fc40025d0f2926aeb91538a5ad1bc5a5cea 100644 --- a/unitgrade/unitgrade.py +++ b/unitgrade/unitgrade.py @@ -98,7 +98,7 @@ class QItem(unittest.TestCase): if tol == None: tol = self.tol diff = np.abs( (np.asarray(computed).flat- np.asarray(expected)).flat ) - nrm = np.sum( diff ** 2) + nrm = np.sqrt(np.sum( diff ** 2)) if nrm > tol: print(f"Not equal within tolerance {tol}; norm of difference was {nrm}") diff --git a/unitgrade/unitgrade_helpers.py b/unitgrade/unitgrade_helpers.py index 3760f82e581e695f96b5adae0d51757b076d6558..45adf1bb58ae5ba36542f59ce1601354c77d1ff0 100644 --- a/unitgrade/unitgrade_helpers.py +++ b/unitgrade/unitgrade_helpers.py @@ -51,7 +51,7 @@ parser.add_argument('--passall', action="store_true", help='Automatically pass # const=sum, default=max, # help='sum the integers (default: find the max)') -def evaluate_report_student(report, question=None, qitem=None, unmute=None, passall=None, ignore_missing_file=False): +def evaluate_report_student(report, question=None, qitem=None, unmute=None, passall=None, ignore_missing_file=False, show_tol_err=False): args = parser.parse_args() if question is None and args.q is not None: question = args.q @@ -68,7 +68,8 @@ def evaluate_report_student(report, question=None, qitem=None, unmute=None, pass if passall is None: passall = args.passall - results, table_data = evaluate_report(report, question=question, show_progress_bar=not unmute, qitem=qitem, verbose=False, passall=passall, show_expected=args.showexpected, show_computed=args.showcomputed,unmute=unmute) + results, table_data = evaluate_report(report, question=question, show_progress_bar=not unmute, qitem=qitem, verbose=False, passall=passall, show_expected=args.showexpected, show_computed=args.showcomputed,unmute=unmute, + show_tol_err=show_tol_err) if question is None: print("Provisional evaluation") @@ -95,7 +96,8 @@ def upack(q): def evaluate_report(report, question=None, qitem=None, passall=False, verbose=False, show_expected=False, show_computed=False,unmute=False, show_help_flag=True, silent=False, - show_progress_bar=True): + show_progress_bar=True, + show_tol_err=False): from unitgrade.version import __version__ now = datetime.now() ascii_banner = pyfiglet.figlet_format("UnitGrade", font="doom") diff --git a/unitgrade/version.py b/unitgrade/version.py index de49d1fae0d98d027750577063be9c8e054ce594..32efefd012eab099f696f3b7ef3cd301baeeaa94 100644 --- a/unitgrade/version.py +++ b/unitgrade/version.py @@ -1 +1 @@ -__version__ = "0.1.5" \ No newline at end of file +__version__ = "0.1.6" \ No newline at end of file