Skip to content

Commit

Permalink
Merge branch 'daredevil' of github.com:arafune/arpes into daredevil
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Apr 17, 2024
2 parents be751f6 + 099b8a4 commit 5d9f289
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
28 changes: 18 additions & 10 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,50 @@ Major Changes from 3.0.1

- Most important change:

- Use correct method to convert from the angle to momentum. (The original way was incorrect)
- Use correct method to convert from the angle to momentum. (The original way was incorrect. And I find most of all python related libraries in github takes the wrong algorithm for converting. I don't want any more incorrect knowledge to spread, but there's nothing I can do about it. Sigh.)

- New feature

- Provide SPD_main.py & prodigy_itx.py
- Provide IF\_\_UMCS.py & prodigy_xy.py
- Introduce Type annotation, which is major trend in the current python coding.
- Users are requested to know type of the object treated. Especially, the users should know the difference between xr.DataArray & xr.Dataset
- Introduce a new attrs, "energy_notation", which determines either "Kinetic" energy or "Binding" energy
- Add new method: S.switch_energy_notation(self, nonlinear_order=1)
- More comatible with ASE.

* Dataset.S.spectra returns the list of the xr.DataArrays whose dims contains "eV". (See xarray_extensions.py)
Add a new method S.swap_angle_unit() to change the angle unit (deg <-> radian)
- After fd3e7cb8 (https://gitlab.com/ase/ase/-/commit/fd3e7cb830b1e0261ff29630b77c5d00868b23d4), plot_bz in ase accepts repeat and rotate.

- Coding guide line
- Dataset.S.spectra returns the list of the xr.DataArrays whose dims contains "eV". (See xarray_extensions.py)
- Add a new method S.swap_angle_unit() to change the angle unit (deg <-> radian)
For presenting the data, degrees unit is more familiar.
- Replace algorithms to make them simpler and more efficient

* Do not carelessly set default=None
* Replace algorithms to make them simpler and more efficient
- stack_plot.py/flat_stack_plot
- analysis/general.py/rebin

- Coding guide line

- stack_plot.py/flat_stack_plot
- analysis/general.py/rebin
- Do not carelessly set default=None
- Not pursuing the graphinca user interface.
- In most case, just want to know the value of the coordinate when GUI is needed, which is enough for using current GUI interface including hvplot. And if GUI is essentially required (for not pythonic user?), using igor would be best. (You don't have to go that far to use Python.)

* Removing

Many files/methods/class have been removed because of inconsistency, legacy style or useless. Here is just a short list the ones I remember now:

- Remove arpes.all

- Certainly, this it is indeed a lazy and carefree approach, but it's too rough method that leads to a bugs and does not mathc the current pythonic style.
- Certainly, this it is indeed a lazy and carefree approach, but it's too rough method that leads to
a bugs and does not mathc the current pythonic style.

- Remove utilities/attrs.py

- The functions in this module have not been used and are unlikely to be used in the future.

- modules that use the Bokeh.

There is a dependency problem among bokeh, tornard, and Jupyter, which I cannot fix because I'm haven't use Bokeh.
There is a dependency problem among bokeh, tornard, and Jupyter, which I cannot fix because I'm haven't use Bokeh. But note that hvplot can work with the current version.

- arpes/plotting/band_tool.py
- arpes/plotting/curvature_tool.py
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/plotting/fermi_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def fermi_edge_reference(
out: Where to save the plot
kwargs: pass to data.plot()
Returns:
[TODO:description]
Returns: Path | Axes
Plot of the result about the Fermi edge fitting
"""
warnings.warn(
"Not automatically correcting for slit shape distortions to the Fermi edge",
Expand Down
6 changes: 3 additions & 3 deletions src/arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,8 @@ def plot(
args: Pass to xr.DataArray.plot
kwargs: Pass to xr.DataArray.plot
"""
if len(self._obj.dims) == TWO_DIMENSION and "rasterized" not in kwargs:
kwargs["rasterized"] = True
if len(self._obj.dims) == TWO_DIMENSION:
kwargs.setdefault("rasterized", True)
with plt.rc_context(rc={"text.usetex": False}):
self._obj.plot(*args, **kwargs)

Expand Down Expand Up @@ -2381,7 +2381,7 @@ def coordinatize(self, as_coordinate_name: str | None = None) -> XrTypes:
if as_coordinate_name is None:
as_coordinate_name = str(dim)

o = self._obj.rename({dim: as_coordinate_name}).copy(deep=True)
o = self._obj.rename({dim: as_coordinate_name})
o.coords[as_coordinate_name] = o.values

return o
Expand Down

0 comments on commit 5d9f289

Please sign in to comment.