diff --git a/ppsci/constraint/boundary_constraint.py b/ppsci/constraint/boundary_constraint.py index d0866c54f..260e830ea 100644 --- a/ppsci/constraint/boundary_constraint.py +++ b/ppsci/constraint/boundary_constraint.py @@ -45,7 +45,7 @@ class BoundaryConstraint(base.Constraint): geom (geometry.Geometry): Geometry where data sampled from. dataloader_cfg (Dict[str, Any]): Dataloader config. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified boundaries. Defaults to None. @@ -79,7 +79,7 @@ def __init__( geom: geometry.Geometry, dataloader_cfg: Dict[str, Any], loss: "loss.Loss", - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, evenly: bool = False, weight_dict: Optional[Dict[str, Union[float, Callable]]] = None, diff --git a/ppsci/constraint/initial_constraint.py b/ppsci/constraint/initial_constraint.py index b8811aedd..65090e68c 100644 --- a/ppsci/constraint/initial_constraint.py +++ b/ppsci/constraint/initial_constraint.py @@ -45,7 +45,7 @@ class InitialConstraint(base.Constraint): geom (geometry.TimeXGeometry): Geometry where data sampled from. dataloader_cfg (Dict[str, Any]): Dataloader config. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified boundaries. Defaults to None. @@ -84,7 +84,7 @@ def __init__( geom: geometry.TimeXGeometry, dataloader_cfg: Dict[str, Any], loss: "loss.Loss", - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, evenly: bool = False, weight_dict: Optional[Dict[str, Callable]] = None, diff --git a/ppsci/constraint/integral_constraint.py b/ppsci/constraint/integral_constraint.py index 1334cb4fc..d3ef0c29a 100644 --- a/ppsci/constraint/integral_constraint.py +++ b/ppsci/constraint/integral_constraint.py @@ -48,7 +48,7 @@ class IntegralConstraint(base.Constraint): geom (geometry.Geometry): Geometry where data sampled from. dataloader_cfg (Dict[str, Any]): Dataloader config. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified boundaries. Defaults to None. @@ -81,7 +81,7 @@ def __init__( geom: geometry.Geometry, dataloader_cfg: Dict[str, Any], loss: "loss.Loss", - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, weight_dict: Optional[Dict[str, Callable]] = None, name: str = "IgC", diff --git a/ppsci/constraint/interior_constraint.py b/ppsci/constraint/interior_constraint.py index 3cbc558a1..fb151a4a5 100644 --- a/ppsci/constraint/interior_constraint.py +++ b/ppsci/constraint/interior_constraint.py @@ -45,7 +45,7 @@ class InteriorConstraint(base.Constraint): geom (geometry.Geometry): Geometry where data sampled from. dataloader_cfg (Dict[str, Any]): Dataloader config. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified boundaries. Defaults to None. @@ -81,7 +81,7 @@ def __init__( geom: geometry.Geometry, dataloader_cfg: Dict[str, Any], loss: "loss.Loss", - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, evenly: bool = False, weight_dict: Optional[Dict[str, Union[Callable, float]]] = None, diff --git a/ppsci/constraint/periodic_constraint.py b/ppsci/constraint/periodic_constraint.py index 7b648c165..54e145a78 100644 --- a/ppsci/constraint/periodic_constraint.py +++ b/ppsci/constraint/periodic_constraint.py @@ -47,7 +47,7 @@ class PeriodicConstraint(base.Constraint): dataloader_cfg (Dict[str, Any]): Dataloader config. periodic_key (str): name of dimension which periodic constraint applied to. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified boundaries. Defaults to None. @@ -66,7 +66,7 @@ def __init__( periodic_key: str, dataloader_cfg: Dict[str, Any], loss: "loss.Loss", - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, evenly: bool = False, weight_dict: Optional[Dict[str, Callable]] = None, diff --git a/ppsci/geometry/sampler.py b/ppsci/geometry/sampler.py index 3960bf29c..4f54f5e33 100644 --- a/ppsci/geometry/sampler.py +++ b/ppsci/geometry/sampler.py @@ -25,7 +25,7 @@ def sample( - n_samples: int, ndim: int, method: Literal["pseudo", "LHS"] = "pseudo" + n_samples: int, ndim: int, method: Literal["pseudo", "Halton", "LHS"] = "pseudo" ) -> np.ndarray: """Generate pseudorandom or quasi-random samples in [0, 1]^ndim. diff --git a/ppsci/validate/geo_validator.py b/ppsci/validate/geo_validator.py index 6741baddc..0551678af 100644 --- a/ppsci/validate/geo_validator.py +++ b/ppsci/validate/geo_validator.py @@ -44,7 +44,7 @@ class GeometryValidator(base.Validator): geom (geometry.Geometry): Geometry where data sampled from. dataloader_cfg (Dict[str, Any]): Dataloader config. loss (loss.Loss): Loss functor. - random (Literal["pseudo", "LHS"], optional): Random method for sampling data in + random (Literal["pseudo", "Halton", "LHS"], optional): Random method for sampling data in geometry. Defaults to "pseudo". criteria (Optional[Callable]): Criteria for refining specified domain. Defaults to None. evenly (bool, optional): Whether to use evenly distribution sampling. Defaults to False. @@ -76,7 +76,7 @@ def __init__( geom: geometry.Geometry, dataloader_cfg: Dict[str, Any], loss: loss.Loss, - random: Literal["pseudo", "LHS"] = "pseudo", + random: Literal["pseudo", "Halton", "LHS"] = "pseudo", criteria: Optional[Callable] = None, evenly: bool = False, metric: Optional[Dict[str, metric.Metric]] = None,