Commit fddbacb
authored
Fix xarray DataArray coord unwrapping in Model.add_coord (#8391)
When xarray Dataset coords are passed directly to pm.Model(coords=...),
the DataArray values were stored as tuples of 0-d DataArrays instead of
plain values. This broke np.array_equal comparisons and InferenceData
export.
Fix by extracting .values from any DataArray before tuple() conversion.1 parent bf8abd5 commit fddbacb
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
1856 | 1857 | | |
1857 | 1858 | | |
1858 | 1859 | | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
1859 | 1866 | | |
1860 | 1867 | | |
1861 | 1868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
873 | 874 | | |
874 | 875 | | |
875 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
876 | 898 | | |
877 | 899 | | |
878 | 900 | | |
| |||
0 commit comments