diff --git a/doc/changelog.rst b/doc/changelog.rst index 3551efba8490a6233e663909f22cb5c7a47ecf68..ccf912b68b509a0306ecf3eba12f70ae24d5652c 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -9,7 +9,7 @@ unreleased - fix :issue:`61` regarding sign of XAS in some cases :mr:`207` - Use xarray.values instead of .to_numpy() for backward-compatibility :mr:`214` - fix :issue:`23` regarding API documentation generation :mr:`221` - - fix :issue:`64`` regarding loading a subset of trains :mr:`226` + - fix :issue:`64`` regarding loading a subset of trains :mr:`226`, :mr:`230` - **Improvements** diff --git a/src/toolbox_scs/load.py b/src/toolbox_scs/load.py index c66dd3816364c6ed4d75a544477f5b89aa530f1c..be22e18ba09dfccbab4c4ccf10baa7e7897f80ea 100644 --- a/src/toolbox_scs/load.py +++ b/src/toolbox_scs/load.py @@ -390,10 +390,12 @@ def get_array(run=None, mnemonic=None, stepsize=None, """ if run is None: run = open_run(proposalNB, runNB, subset, data=subFolder) - if not isinstance(run, ed.DataCollection): - raise TypeError(f'run argument has type {type(run)} but ' - 'expected type is extra_data.DataCollection') - run = run.select_trains(subset) + else: + if not isinstance(run, ed.DataCollection): + raise TypeError(f'run argument has type {type(run)} but ' + 'expected type is extra_data.DataCollection') + if subset is not None: + run = run.select_trains(subset) run_mnemonics = mnemonics_for_run(run) try: