Skip to content

Commit

Permalink
Merge branch 'master' into ddkohler-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkohler authored Mar 20, 2024
2 parents 22867af + e822e33 commit 5736e62
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 287 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: test python

on: [push, pull_request]
on:
pull_request:
types: [opened, reopened]
push:

jobs:
build:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
## [Unreleased]

### Fixed
- wt5 explore : fixed but where data will not load interactively if directory is not cwd
- wt5 explore : fixed bug where data will not load interactively if directory is not cwd
- constants in chopped data will inherit the units of the original data

## Changed
- artists now gets turbo colormap straight from matplotlib

## [3.5.2]

Expand Down
3 changes: 0 additions & 3 deletions WrightTools/artists/_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import matplotlib.colors as mplcolors
import matplotlib.gridspec as grd

from ._turbo import turbo


# --- define -------------------------------------------------------------------------------------

Expand Down Expand Up @@ -438,7 +436,6 @@ def __getitem__(self, key):
colormaps["skyebar1"] = mplcolors.LinearSegmentedColormap.from_list("skyebar", skyebar)
colormaps["skyebar2"] = mplcolors.LinearSegmentedColormap.from_list("skyebar dark", skyebar_d)
colormaps["skyebar3"] = mplcolors.LinearSegmentedColormap.from_list("skyebar inverted", skyebar_i)
colormaps["turbo"] = turbo
colormaps["wright"] = mplcolors.LinearSegmentedColormap.from_list("wright", wright)


Expand Down
280 changes: 0 additions & 280 deletions WrightTools/artists/_turbo.py

This file was deleted.

11 changes: 10 additions & 1 deletion WrightTools/data/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ def _from_slice(self, idx, name=None, parent=None) -> Data:

for const in list(self.constant_expressions) + constants:
out.create_constant(const, verbose=False)
if const in self.constant_expressions:
dest_units = self.constants[self.constant_expressions.index(const)].units
else:
dest_units = self.axes[self.axis_expressions.index(const)].units
out.constants[out.constant_expressions.index(const)].convert(dest_units)
for j, units in enumerate(new_axis_units):
out.axes[j].convert(units)

Expand Down Expand Up @@ -1263,10 +1268,14 @@ def level(self, channel, axis, npts, *, verbose=True):
def map_variable(
self, variable, points, input_units="same", *, name=None, parent=None, verbose=True
) -> "Data":
"""Map points of an axis to new points using linear interpolation.
"""
Map points of an axis to new points using linear interpolation.
Out-of-bounds points are written nan.
Non-mapped variables are kept in the data object only if they are
orthogonal to the mapped variable (see `kit.orthogonal`).
Parameters
----------
variable : string
Expand Down
4 changes: 3 additions & 1 deletion tests/data/chop.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ def test_3D_to_2D_units():
assert d.w2.size == 11
assert d.axis_expressions == ("wm", "w2")
assert d.units == ("eV", "eV")
data.close()
w1 = d.constants[d.constant_names.index("w1")]
assert w1.units == "eV"
chop.close()
data.close()


def test_parent():
Expand Down

0 comments on commit 5736e62

Please sign in to comment.