mirror of
				https://github.com/Akkudoktor-EOS/EOS.git
				synced 2025-10-30 22:36:21 +00:00 
			
		
		
		
	* mate -> cxTwoPoints needs at least two elements.
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							edfe309a26
						
					
				
				
					commit
					777303a2b7
				
			| @@ -3,7 +3,7 @@ from typing import Any, Optional, Tuple | ||||
|  | ||||
| import numpy as np | ||||
| from deap import algorithms, base, creator, tools | ||||
| from pydantic import BaseModel, Field, model_validator | ||||
| from pydantic import BaseModel, Field, field_validator, model_validator | ||||
| from typing_extensions import Self | ||||
|  | ||||
| from akkudoktoreos.class_akku import EAutoParameters, PVAkku, PVAkkuParameters | ||||
| @@ -40,6 +40,14 @@ class OptimizationParameters(BaseModel): | ||||
|             raise ValueError("Input lists have different lenghts") | ||||
|         return self | ||||
|  | ||||
|     @field_validator("start_solution") | ||||
|     def validate_start_solution( | ||||
|         cls, start_solution: Optional[list[float]] | ||||
|     ) -> Optional[list[float]]: | ||||
|         if start_solution is not None and len(start_solution) < 2: | ||||
|             raise ValueError("Requires at least two values.") | ||||
|         return start_solution | ||||
|  | ||||
|  | ||||
| class EAutoResult(BaseModel): | ||||
|     """This object contains information related to the electric vehicle and its charging and discharging behavior.""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user