Skip to content

Commit

Permalink
chore: run lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Aug 8, 2024
1 parent 028fa4b commit a7c1993
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/py/mat3ra/made/tools/build/perturbation/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

class PerturbationConfiguration(BaseModel, InMemoryEntity):
material: Material
perturbation_function_holder: Union[SineWavePerturbationFunctionHolder, GeneralPerturbationFunctionHolder] = (
SineWavePerturbationFunctionHolder()
)
perturbation_function_holder: Union[
SineWavePerturbationFunctionHolder, GeneralPerturbationFunctionHolder
] = SineWavePerturbationFunctionHolder()
use_cartesian_coordinates: bool = True

class Config:
Expand Down
8 changes: 5 additions & 3 deletions src/py/mat3ra/made/tools/utils/functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List, Literal, Callable, Any
from typing import Any, Callable, List, Literal

import numpy as np
import sympy as sp
from pydantic import BaseModel
from scipy.integrate import quad
from scipy.optimize import root_scalar
Expand Down Expand Up @@ -105,14 +106,15 @@ def get_json(self) -> dict:
}


import sympy as sp
def default_function(coordinate: List[float]) -> float:
return 0


class GeneralPerturbationFunctionHolder(PerturbationFunctionHolder):
variables: List[str] = ["x"]
symbols: List[sp.Symbol] = [sp.Symbol(var) for var in variables]
function: sp.Expr = sp.Symbol("f")
function_numeric: Callable = lambda x: x
function_numeric: Callable = default_function
derivatives_numeric: dict = {}

class Config:
Expand Down

0 comments on commit a7c1993

Please sign in to comment.