@@ -565,6 +565,36 @@ def load_parameters(
565
565
parameters : Dataset
566
566
Loaded xarray Dataset with parameters.
567
567
"""
568
+ for param in self .experiment .parameter_configuration .values ():
569
+ if isinstance (param , ScalarParameters ) and group in param .groups :
570
+ if isinstance (realizations , int ):
571
+ realizations = np .array ([realizations ])
572
+ df = self .load_parameters_scalar (
573
+ scalar_name = param .name , realizations = realizations , group = group
574
+ )
575
+ reals = df .select ("realization" ).to_numpy ().flatten ()
576
+ dataset = []
577
+ param_cols = [
578
+ col
579
+ for col in df .columns
580
+ if not col .endswith (".transformed" ) and col != "realization"
581
+ ]
582
+ for real in reals :
583
+ df_single = df .filter (pl .col ("realization" ) == real )
584
+ raw_values = df_single .select (param_cols ).row (0 )
585
+ transformed_values = df_single .select (
586
+ [f"{ col } .transformed" for col in param_cols ]
587
+ ).row (0 )
588
+ ds_single = xr .Dataset (
589
+ {
590
+ "values" : ("names" , raw_values ),
591
+ "transformed_values" : ("names" , transformed_values ),
592
+ "names" : ("names" , param_cols ),
593
+ },
594
+ coords = {"realizations" : real },
595
+ )
596
+ dataset .append (ds_single )
597
+ return xr .combine_nested (dataset , concat_dim = "realizations" )
568
598
569
599
return self ._load_dataset (group , realizations )
570
600
0 commit comments