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

Zqs 920 loss function wrapper #33

Merged
merged 8 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed style issues.
  • Loading branch information
mstechly committed Jan 20, 2022
commit fcc2b3221eba0ca900fb660190b25bbc3e101331
3 changes: 2 additions & 1 deletion src/orqviz/loss_function.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from typing import Callable, Optional

import numpy as np
import time


def _calculate_new_average(
Expand Down
2 changes: 1 addition & 1 deletion src/orqviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def load_viz_object(filename: str) -> OrqVizObject:
please use orqviz.io.load_viz_object""",
DeprecationWarning,
)
return _load_viz_object(filename)
return _load_viz_object(filename)
2 changes: 1 addition & 1 deletion tests/orqviz/io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from orqviz.elastic_band.data_structures import Chain
from orqviz.hessians import get_Hessian
from orqviz.scans import perform_1D_scan, perform_2D_scan
from orqviz.io import OrqVizObject, load_viz_object, save_viz_object
from orqviz.scans import perform_1D_scan, perform_2D_scan


def SUM_OF_SINES(params):
Expand Down
3 changes: 2 additions & 1 deletion tests/orqviz/loss_function_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from orqviz.loss_function import LossFunctionWrapper
import numpy as np

from orqviz.loss_function import LossFunctionWrapper


def mock_function(params, b, c):
return np.sum(params * b + c)
Expand Down
2 changes: 0 additions & 2 deletions tests/orqviz/scans/scans_plots_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import matplotlib.pyplot as plt
import numpy as np
import pytest

from orqviz.io import load_viz_object, save_viz_object
from orqviz.scans import perform_1D_scan, perform_2D_interpolation
Expand All @@ -12,7 +11,6 @@
plot_2D_interpolation_result,
plot_2D_scan_result,
)
from orqviz.io import load_viz_object, save_viz_object


def SUM_OF_SINES(params):
Expand Down
6 changes: 0 additions & 6 deletions tests/orqviz/scans/scans_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
perform_2D_interpolation,
)
from orqviz.scans.data_structures import Scan1DResult, Scan2DResult
from orqviz.scans.plots import (
plot_1D_scan_result,
plot_2D_interpolation_result,
plot_2D_scan_result,
)
from orqviz.scans.scans_2D import perform_2D_scan
from orqviz.io import load_viz_object, save_viz_object


def SUM_OF_SINES(params):
Expand Down
2 changes: 1 addition & 1 deletion tests/orqviz/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def test_saving_and_loading_datatypes():
loaded_data_object = load_viz_object("test")
os.remove("test")
assert isinstance(loaded_data_object, OrqVizObject.__args__)
assert type(loaded_data_object) == type(data_object)
assert type(loaded_data_object) == type(data_object)