-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
106,862 additions
and
106,862 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
unittest: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9, '3.10', '3.11', '3.12'] | ||
steps: | ||
- name: Checkout PyAutoConf | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: rhayes777/PyAutoConf | ||
path: PyAutoConf | ||
- name: Checkout PyAutoArray | ||
uses: actions/checkout@v2 | ||
with: | ||
path: PyAutoArray | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/cache@v2 | ||
id: cache-pip | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
# if: steps.cache-pip.outputs.cache-hit != 'true' | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install setuptools | ||
pip3 install wheel | ||
pip3 install pytest coverage pytest-cov | ||
pip3 install -r PyAutoConf/requirements.txt | ||
pip3 install -r PyAutoArray/requirements.txt | ||
pip3 install -r PyAutoArray/optional_requirements.txt | ||
cd PyAutoArray/autoarray/util/nn/src/nn | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | ||
bash ./configure | ||
cp makefile_autolens makefile | ||
make | ||
cd /home/runner/work/PyAutoArray/PyAutoArray | ||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
cd PyAutoArray | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
- name: Change to same branch if exists in deps | ||
shell: bash | ||
run: | | ||
export PACKAGES=("PyAutoConf") | ||
export BRANCH="${{ steps.extract_branch.outputs.branch }}" | ||
for PACKAGE in ${PACKAGES[@]}; do | ||
pushd $PACKAGE | ||
export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) | ||
if [[ -z ${existed_in_remote} ]]; then | ||
echo "Branch $BRANCH did not exist in $PACKAGE" | ||
else | ||
echo "Branch $BRANCH did exist in $PACKAGE" | ||
git fetch | ||
git checkout $BRANCH | ||
fi | ||
popd | ||
done | ||
- name: Run tests | ||
run: | | ||
export ROOT_DIR=`pwd` | ||
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf | ||
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | ||
pushd PyAutoArray | ||
python3 -m pytest --cov autoarray --cov-report xml:coverage.xml | ||
- name: Slack send | ||
if: ${{ failure() }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
channel-id: C03S98FEDK2 | ||
payload: | | ||
{ | ||
"text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
unittest: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9, '3.10', '3.11', '3.12'] | ||
steps: | ||
- name: Checkout PyAutoConf | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: rhayes777/PyAutoConf | ||
path: PyAutoConf | ||
- name: Checkout PyAutoArray | ||
uses: actions/checkout@v2 | ||
with: | ||
path: PyAutoArray | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/cache@v2 | ||
id: cache-pip | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
# if: steps.cache-pip.outputs.cache-hit != 'true' | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install setuptools | ||
pip3 install wheel | ||
pip3 install pytest coverage pytest-cov | ||
pip3 install -r PyAutoConf/requirements.txt | ||
pip3 install -r PyAutoArray/requirements.txt | ||
pip3 install -r PyAutoArray/optional_requirements.txt | ||
cd PyAutoArray/autoarray/util/nn/src/nn | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | ||
bash ./configure | ||
cp makefile_autolens makefile | ||
make | ||
cd /home/runner/work/PyAutoArray/PyAutoArray | ||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
cd PyAutoArray | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
- name: Change to same branch if exists in deps | ||
shell: bash | ||
run: | | ||
export PACKAGES=("PyAutoConf") | ||
export BRANCH="${{ steps.extract_branch.outputs.branch }}" | ||
for PACKAGE in ${PACKAGES[@]}; do | ||
pushd $PACKAGE | ||
export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) | ||
if [[ -z ${existed_in_remote} ]]; then | ||
echo "Branch $BRANCH did not exist in $PACKAGE" | ||
else | ||
echo "Branch $BRANCH did exist in $PACKAGE" | ||
git fetch | ||
git checkout $BRANCH | ||
fi | ||
popd | ||
done | ||
- name: Run tests | ||
run: | | ||
export ROOT_DIR=`pwd` | ||
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf | ||
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | ||
pushd PyAutoArray | ||
python3 -m pytest --cov autoarray --cov-report xml:coverage.xml | ||
- name: Slack send | ||
if: ${{ failure() }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
channel-id: C03S98FEDK2 | ||
payload: | | ||
{ | ||
"text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
fits: | ||
flip_for_ds9: false # If True, the image is flipped before output to a .fits file, which is useful for viewing in DS9. | ||
inversion: | ||
check_reconstruction: true # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same. | ||
use_positive_only_solver: true # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion. | ||
no_regularization_add_to_curvature_diag_value : 1.0e-3 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular. | ||
positive_only_uses_p_initial: true # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver. | ||
use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. | ||
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor. | ||
numba: | ||
use_numba: true | ||
cache: false | ||
nopython: true | ||
parallel: false | ||
pixelization: | ||
voronoi_nn_max_interpolation_neighbors: 300 | ||
structures: | ||
native_binned_only: false # If True, data structures are only stored in their native and binned format. This is used to reduce memory usage in autocti. | ||
fits: | ||
flip_for_ds9: false # If True, the image is flipped before output to a .fits file, which is useful for viewing in DS9. | ||
inversion: | ||
check_reconstruction: true # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same. | ||
use_positive_only_solver: true # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion. | ||
no_regularization_add_to_curvature_diag_value : 1.0e-3 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular. | ||
positive_only_uses_p_initial: true # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver. | ||
use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. | ||
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor. | ||
numba: | ||
use_numba: true | ||
cache: false | ||
nopython: true | ||
parallel: false | ||
pixelization: | ||
voronoi_nn_max_interpolation_neighbors: 300 | ||
structures: | ||
native_binned_only: false # If True, data structures are only stored in their native and binned format. This is used to reduce memory usage in autocti. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
radial_minimum: | ||
function_name: | ||
class_name: 1.0e-08 | ||
radial_minimum: | ||
function_name: | ||
class_name: 1.0e-08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
version: 1 | ||
disable_existing_loggers: false | ||
|
||
handlers: | ||
console: | ||
class: logging.StreamHandler | ||
level: INFO | ||
stream: ext://sys.stdout | ||
formatter: formatter | ||
file: | ||
class: logging.FileHandler | ||
level: INFO | ||
filename: root.log | ||
formatter: formatter | ||
|
||
root: | ||
level: INFO | ||
handlers: [ console, file ] | ||
|
||
formatters: | ||
formatter: | ||
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | ||
version: 1 | ||
disable_existing_loggers: false | ||
|
||
handlers: | ||
console: | ||
class: logging.StreamHandler | ||
level: INFO | ||
stream: ext://sys.stdout | ||
formatter: formatter | ||
file: | ||
class: logging.FileHandler | ||
level: INFO | ||
filename: root.log | ||
formatter: formatter | ||
|
||
root: | ||
level: INFO | ||
handlers: [ console, file ] | ||
|
||
formatters: | ||
formatter: | ||
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import logging | ||
|
||
from os import environ | ||
|
||
use_jax = environ.get("USE_JAX", "0") == "1" | ||
|
||
if use_jax: | ||
try: | ||
import jax | ||
from jax import numpy as np, jit | ||
|
||
print("JAX mode enabled") | ||
except ImportError: | ||
raise ImportError( | ||
"JAX is not installed. Please install it with `pip install jax`." | ||
) | ||
else: | ||
import numpy as np | ||
|
||
def jit(function, *_, **__): | ||
return function | ||
|
||
|
||
try: | ||
from jax._src.tree_util import register_pytree_node | ||
from jax._src.tree_util import register_pytree_node_class | ||
|
||
from jax import Array | ||
except ImportError: | ||
|
||
def register_pytree_node_class(cls): | ||
return cls | ||
|
||
def register_pytree_node(*_, **__): | ||
pass | ||
|
||
Array = np.ndarray | ||
import logging | ||
|
||
from os import environ | ||
|
||
use_jax = environ.get("USE_JAX", "0") == "1" | ||
|
||
if use_jax: | ||
try: | ||
import jax | ||
from jax import numpy as np, jit | ||
|
||
print("JAX mode enabled") | ||
except ImportError: | ||
raise ImportError( | ||
"JAX is not installed. Please install it with `pip install jax`." | ||
) | ||
else: | ||
import numpy as np | ||
|
||
def jit(function, *_, **__): | ||
return function | ||
|
||
|
||
try: | ||
from jax._src.tree_util import register_pytree_node | ||
from jax._src.tree_util import register_pytree_node_class | ||
|
||
from jax import Array | ||
except ImportError: | ||
|
||
def register_pytree_node_class(cls): | ||
return cls | ||
|
||
def register_pytree_node(*_, **__): | ||
pass | ||
|
||
Array = np.ndarray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.