Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
103 changes: 103 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# PyARPES Specific
resources/
scripts/

# Git
.git
.gitignore

# Docker
docker-compose.yml
.docker

# Byte-compiled / optimized / DLL files
__pycache__/
*/__pycache__/
*/*/__pycache__/
*/*/*/__pycache__/
*.py[cod]
*/*.py[cod]
*/*/*.py[cod]
*/*/*/*.py[cod]

# C extensions
*.so

# Test related
.pytest_cache/

# Conda related
conda/

# Documentation related
docs/

# Distribution / packaging
node_modules/
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
*.lock

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env/
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
*/.ropeproject
*/*/.ropeproject
*/*/*/.ropeproject

# Vim swap files
*.swp
*/*.swp
*/*/*.swp
*/*/*/*.swp
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Sensitive
containers/fairmat-original

# Editors
*.code-workspace
.vscode/
Expand Down
31 changes: 29 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,34 @@ Pip installation

::

pip install arpes
pip install arpes[all]
# optionally
# pip install arpes[standard]
# pip install arpes[core]
# ... see the feature bundles section below for more details

Feature bundles and extra requirements
--------------------------------------

Not all users need all PyARPES features. You can specify which sets of feautures
you want using brackets after the `arpes` package name in order to specify
what functionality you need. Available options are

1. `slim`
2. `standard`
3. `all`
4. `legacy_ui`
5. `ml`

If you do not specify an extra requirements group, the installation will defualt to use
`slim`. `legacy_ui` provides support for in Jupyter interactive analysis tools via Bokeh.
These have been superseded by tools written with Qt. `ml` provides support for funtionality
requiring `scikit-learn` and its derivatives. Notably, this includes the decomposition functionality
for data exploration like `arpes.decomposition.pca_along` and `arpes.widgets.pca_explorer`.

You should use `pip install arpes[standard]` unless you know that what you want is only
provided by `slim` or `all`. `legacy_ui` and `ml` are included in `all`.



Conda installation
Expand All @@ -68,7 +95,7 @@ A minimal install looks like
::

conda config --append channels conda-forge
conda install -c arpes -c conda-forge arpes
conda install -c arpes -c conda-forge arpes[all]


Local installation from source
Expand Down
6 changes: 6 additions & 0 deletions arpes/analysis/decomposition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Provides array decomposition approaches like principal component analysis for xarray types."""
from functools import wraps
from arpes.feature_gate import Gates, gate

from arpes.provenance import provenance
from arpes.typing import DataType
Expand All @@ -15,6 +16,7 @@
)


@gate(Gates.ML)
def decomposition_along(
data: DataType, axes: List[str], decomposition_cls, correlation=False, **kwargs
) -> Tuple[DataType, Any]:
Expand Down Expand Up @@ -103,6 +105,7 @@ def decomposition_along(
return into, decomp


@gate(Gates.ML)
@wraps(decomposition_along)
def pca_along(*args, **kwargs):
"""Specializes `decomposition_along` with `sklearn.decomposition.PCA`."""
Expand All @@ -111,6 +114,7 @@ def pca_along(*args, **kwargs):
return decomposition_along(*args, **kwargs, decomposition_cls=PCA)


@gate(Gates.ML)
@wraps(decomposition_along)
def factor_analysis_along(*args, **kwargs):
"""Specializes `decomposition_along` with `sklearn.decomposition.FactorAnalysis`."""
Expand All @@ -119,6 +123,7 @@ def factor_analysis_along(*args, **kwargs):
return decomposition_along(*args, **kwargs, decomposition_cls=FactorAnalysis)


@gate(Gates.ML)
@wraps(decomposition_along)
def ica_along(*args, **kwargs):
"""Specializes `decomposition_along` with `sklearn.decomposition.FastICA`."""
Expand All @@ -127,6 +132,7 @@ def ica_along(*args, **kwargs):
return decomposition_along(*args, **kwargs, decomposition_cls=FastICA)


@gate(Gates.ML)
@wraps(decomposition_along)
def nmf_along(*args, **kwargs):
"""Specializes `decomposition_along` with `sklearn.decomposition.NMF`."""
Expand Down
5 changes: 4 additions & 1 deletion arpes/analysis/pocket.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Contains electron/hole pocket analysis routines."""
import numpy as np
from sklearn.decomposition import PCA

import xarray as xr
from arpes.fits.fit_models import AffineBackgroundModel, LorentzianModel
from arpes.provenance import update_provenance
from arpes.typing import DataType
from arpes.utilities import normalize_to_spectrum
from arpes.utilities.conversion import slice_along_path
from arpes.feature_gate import gate, Gates

from typing import List, Tuple

Expand All @@ -19,6 +19,7 @@
)


@gate(Gates.ML)
def pocket_parameters(data: DataType, kf_method=None, sel=None, method_kwargs=None, **kwargs):
"""Estimates pocket center, anisotropy, principal vectors, and extent in either angle or k-space.

Expand All @@ -35,6 +36,8 @@ def pocket_parameters(data: DataType, kf_method=None, sel=None, method_kwargs=No
Returns:
Extracted asymmetry parameters.
"""
from sklearn.decomposition import PCA

slices, _ = curves_along_pocket(data, **kwargs) # slices, angles =

if kf_method is None:
Expand Down
4 changes: 4 additions & 0 deletions arpes/analysis/self_energy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains self-energy analysis routines."""
from arpes.feature_gate import Gates, gate
import xarray as xr
import lmfit as lf
import numpy as np
Expand Down Expand Up @@ -71,6 +72,9 @@ def local_fermi_velocity(bare_band: xr.DataArray):
return raw_velocity * METERS_PER_SECOND_PER_EV_ANGSTROM


gate(Gates.ML)


def estimate_bare_band(dispersion: xr.DataArray, bare_band_specification: Optional[str] = None):
"""Estimates the bare band from a fitted dispersion.

Expand Down
4 changes: 4 additions & 0 deletions arpes/deep_learning/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ class Identity:
"""Represents a reversible identity transform."""

def encodes(self, x):
"""Identity transform."""
return x

def __call__(self, x):
"""Passthrough for `self.encodes`."""
return x

def decodes(self, x):
"""The inverse of the idenity transform is also the identity."""
return x

def __repr__(self):
"""Just include the class name since there are no parameters here."""
return "Identity()"


Expand Down
1 change: 1 addition & 0 deletions arpes/endstations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class EndstationBase:
trace: Trace

def __init__(self):
"""Setup a trace object so that it can be used throughout the load steps."""
self.trace = Trace(silent=True)

@classmethod
Expand Down
Loading