Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add native xarray support and concatenation of DataFrames/DataArrays #2507

Merged
merged 47 commits into from
Jan 27, 2021
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1567486
kwarg for concatenation of dataframes
nikhartman Dec 9, 2020
0ee553a
cleanup concat output
nikhartman Dec 9, 2020
45f6aeb
docs for dataframe output
nikhartman Dec 9, 2020
c7df542
add xarray method
nikhartman Dec 10, 2020
cf8200a
use parameter_data to determine if index is the same
nikhartman Dec 10, 2020
2df96af
fix docs
nikhartman Dec 10, 2020
37e3cbe
adding xarray to env files
trevormorgan Jan 14, 2021
9e65dbd
removed douplicated and sorted alphabetically
trevormorgan Jan 15, 2021
d783be9
small example for xarray from dataset
trevormorgan Jan 15, 2021
6d6e85e
return df or xarray dset if concat=True
trevormorgan Jan 15, 2021
cb662ca
add attr for all paramspecs
trevormorgan Jan 16, 2021
bfc07cf
revert atrtr for coords
trevormorgan Jan 16, 2021
1ec7370
add coord attr data from paramspec
trevormorgan Jan 18, 2021
9daf4a1
convert to str
trevormorgan Jan 18, 2021
c97a02b
fixed typing errors
trevormorgan Jan 19, 2021
aa5b65c
trim whitespace
trevormorgan Jan 19, 2021
cde8b21
update doc string, line length
trevormorgan Jan 19, 2021
bb4c536
fix doc string for doc build error
trevormorgan Jan 19, 2021
3aad8ab
remove white space
trevormorgan Jan 19, 2021
9b8c75e
remove white space in doc string
trevormorgan Jan 20, 2021
0e299fa
created seperate functions for xr dataset and dataarray return
trevormorgan Jan 21, 2021
5055035
revert get_data_as_pandas_dataframe
trevormorgan Jan 21, 2021
41ca420
fix spacing
trevormorgan Jan 21, 2021
29a4020
change name to _sp_iterator and add starmap
trevormorgan Jan 24, 2021
c7128f8
add xarray to setup
trevormorgan Jan 24, 2021
f2f7229
added seperate methods for pandas dataframe
trevormorgan Jan 25, 2021
80160a2
updates for seperate pandas dataframe methods on datasets
trevormorgan Jan 25, 2021
cbcbc43
Merge branch 'master' into nik/as_xarray
trevormorgan Jan 25, 2021
ecd910d
added xarray to setup with strict version
trevormorgan Jan 25, 2021
784a094
update to docs for using pandas and xarray
trevormorgan Jan 26, 2021
f0535ab
fix same_setpoint error by using starmap
trevormorgan Jan 26, 2021
53a6d89
add mew blank cell
trevormorgan Jan 26, 2021
296e4f7
Update Accessing-data-in-DataSet.ipynb
trevormorgan Jan 26, 2021
c2f9222
use current release of pandas
trevormorgan Jan 26, 2021
91b88ed
Merge branch 'nik/as_xarray' of https://github.com/nikhartman/Qcodes …
trevormorgan Jan 26, 2021
30dac35
fix xarray old method call
trevormorgan Jan 26, 2021
679f944
fix method call rename
trevormorgan Jan 26, 2021
543a9d8
set min ver to 0.25.0 for xarray
trevormorgan Jan 26, 2021
2a4e888
Update 15_minutes_to_QCoDeS.ipynb
trevormorgan Jan 26, 2021
cdca2c7
Merge branch 'master' into nik/as_xarray
astafan8 Jan 26, 2021
19d3f05
Merge branch 'master' into nik/as_xarray
trevormorgan Jan 26, 2021
e7a5cb3
fix strange syntax issue
trevormorgan Jan 27, 2021
e9928ab
Merge branch 'nik/as_xarray' of https://github.com/nikhartman/Qcodes …
trevormorgan Jan 27, 2021
c7b80ff
assert equals fix for same setpoint
trevormorgan Jan 27, 2021
d9d66cb
added unit test for same_setpoint warning plus rearrange private methods
trevormorgan Jan 27, 2021
fd68f61
respect max line length for readability
astafan8 Jan 27, 2021
8dc3634
Merge branch 'master' into nik/as_xarray
astafan8 Jan 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions qcodes/dataset/data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import uuid
from dataclasses import dataclass
from queue import Empty, Queue
from itertools import starmap
from threading import Thread
from typing import (Hashable, Iterator, TYPE_CHECKING, Any, Callable, Dict,
List, Mapping, MutableMapping, Optional, Sequence, Set,
Expand Down Expand Up @@ -949,22 +950,17 @@ def _parameter_data_identical(param_dict_a: Dict[str, numpy.ndarray],

def _same_setpoints(self, datadict: ParameterData) -> bool:

def _get_setpoints(dd: ParameterData) -> Iterator[Dict[str, numpy.ndarray]]:
def _sp_iterator(dd: ParameterData) -> Iterator[Dict[str, numpy.ndarray]]:

for dep_name, param_dict in dd.items():
out = {
name: vals for name, vals in param_dict.items() if name != dep_name
}
yield out

iterator = _get_setpoints(datadict)
trevormorgan marked this conversation as resolved.
Show resolved Hide resolved
iterator = _sp_iterator(datadict)

try:
first = next(iterator)
except StopIteration:
return True

return all(self._parameter_data_identical(first, rest) for rest in iterator)
return all(starmap(self._parameter_data_identical, iterator))

def get_data_as_pandas_dataframe(self,
*params: Union[str,
Expand Down