Skip to content

Commit

Permalink
Merge pull request #2449 from PrincetonUniversity/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
kmantel authored Jul 28, 2022
2 parents 7072684 + 0be359f commit d1c854d
Show file tree
Hide file tree
Showing 130 changed files with 6,293 additions and 2,463 deletions.
19 changes: 19 additions & 0 deletions .github/actions/install-pnl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ runs:
[[ ${{ runner.os }} = Windows* ]] && pip install "pywinpty<1" "terminado<0.10"
fi
- name: Install updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') && matrix.pnl-version != 'base' }}
shell: bash
id: new_package
run: |
python -m pip install --upgrade pip wheel
export NEW_PACKAGE=`echo '${{ github.head_ref }}' | cut -f 4 -d/ | sed 's/-gt.*//' | sed 's/-lt.*//'`
echo "::set-output name=new_package::$NEW_PACKAGE"
pip install "`echo $NEW_PACKAGE | sed 's/[-_]/./g' | xargs grep *requirements.txt -h -e | head -n1`"
pip show "$NEW_PACKAGE" | grep 'Version' | tee new_version.deps
- name: Python dependencies
shell: bash
run: |
Expand All @@ -66,3 +77,11 @@ runs:
pip cache remove -v $P || true
fi
done
- name: Check updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') && matrix.pnl-version != 'base' }}
shell: bash
run: |
pip show ${{ steps.new_package.outputs.new_package }} | grep 'Version' | tee installed_version.deps
cmp -s new_version.deps installed_version.deps || echo "::error::Package version restricted by dependencies: ${{ steps.new_package.outputs.new_package }}"
diff new_version.deps installed_version.deps
4 changes: 2 additions & 2 deletions .github/workflows/compare-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: 'Download docs artifacts'
id: docs-artifacts
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
(diff -r docs-base docs-head && echo 'No differences!' || true) | tee ./result.diff
- name: Post comment with docs diff
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
var fs = require('fs');
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pnl-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
branch: master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
Expand Down Expand Up @@ -94,17 +94,21 @@ jobs:
- name: Add git tag
# The generated docs include PNL version,
# set it to a fixed value to prevent polluting the diff
# This needs to be done after installing PNL
# to not interfere with dependency resolution
id: add_zero_tag
if: github.event_name == 'pull_request'
run: git tag --force 'v999.999.999.999'
run: git tag --force 'v0.0.0.0'

- name: Build Documentation
run: make -C docs/ html -e SPHINXOPTS="-aE -j auto"

- name: Remove git tag
# The generated docs include PNL version,
# This was set to a fixed value to prevent polluting the diff
if: github.event_name == 'pull_request' && always()
run: git tag -d 'v999.999.999.999'
# A special tag was set to a fixed value
# to prevent polluting the diff
if: steps.add_zero_tag.outcome != 'skipped'
run: git tag -d 'v0.0.0.0'

- name: Upload Documentation
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -151,7 +155,7 @@ jobs:
ref: gh-pages

- name: Download branch docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
path: _built_docs/${{ github.ref }}
Expand All @@ -168,7 +172,7 @@ jobs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'

- name: Download main docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
# This overwrites files in current directory
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
extra-args: ['']
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# 3.7 is broken on macos-11, https://github.com/actions/virtual-environments/issues/4230
- python-version: 3.7
python-architecture: 'x64'
os: macos-10.15
# add 32-bit build on windows
- python-version: 3.8
python-architecture: 'x86'
Expand Down Expand Up @@ -54,7 +50,7 @@ jobs:
run: git fetch --tags origin master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -78,13 +78,13 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/
Expand Down Expand Up @@ -175,13 +175,13 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/

- name: Upload dist files to release
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
const fs = require('fs')
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Created by https://www.gitignore.io/api/osx,python,pycharm

# Ignore JSON files created in tests/json/
# Ignore JSON files created in tests/mdf/
# Maybe these should be generated in tmpdir instead
tests/json/*.json
tests/mdf/*.json

# Log files created by SLURM jobs in this directory
Scripts/Debug/predator_prey_opt/logs/
Expand Down
25 changes: 25 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@
def pytest_addoption(parser):
parser.addoption('--{0}'.format(mark_stress_tests), action='store_true', default=False, help='Run {0} tests (long)'.format(mark_stress_tests))

parser.addoption('--fp-precision', action='store', default='fp64', choices=['fp32', 'fp64'],
help='Set default fp precision for the runtime compiler. Default: fp64')

def pytest_sessionstart(session):
precision = session.config.getvalue("--fp-precision")
if precision == 'fp64':
pnlvm.LLVMBuilderContext.default_float_ty = pnlvm.ir.DoubleType()
elif precision == 'fp32':
pnlvm.LLVMBuilderContext.default_float_ty = pnlvm.ir.FloatType()
else:
assert False, "Unsupported precision parameter: {}".format(precision)

def pytest_runtest_setup(item):
# Check that all 'cuda' tests are also marked 'llvm'
assert 'llvm' in item.keywords or 'cuda' not in item.keywords

for m in marks_default_skip:
if m in item.keywords and not item.config.getvalue(m):
pytest.skip('{0} tests not requested'.format(m))
Expand Down Expand Up @@ -97,6 +112,16 @@ def comp_mode_no_llvm():
# dummy fixture to allow 'comp_mode' filtering
pass

@pytest.helpers.register
def llvm_current_fp_precision():
float_ty = pnlvm.LLVMBuilderContext.get_current().float_ty
if float_ty == pnlvm.ir.DoubleType():
return 'fp64'
elif float_ty == pnlvm.ir.FloatType():
return 'fp32'
else:
assert False, "Unknown floating point type: {}".format(float_ty)

@pytest.helpers.register
def get_comp_execution_modes():
return [pytest.param(pnlvm.ExecutionMode.Python),
Expand Down
2 changes: 1 addition & 1 deletion cuda_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pycuda >2018, <2022
pycuda >2018, <2023
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupyter<=1.0.0
pytest<7.1.2
pytest<7.1.3
pytest-benchmark<3.4.2
pytest-cov<3.0.1
pytest-helpers-namespace<2021.12.30
Expand Down
2 changes: 1 addition & 1 deletion doc_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
psyneulink-sphinx-theme<1.2.3.1
psyneulink-sphinx-theme<1.2.4.1
sphinx<4.2.1
sphinx_autodoc_typehints<1.16.0
Loading

0 comments on commit d1c854d

Please sign in to comment.