Skip to content

Commit 9b68ab8

Browse files
authored
Merge pull request #2897 from PrincetonUniversity/devel
Devel
2 parents f062be4 + 47a59ec commit 9b68ab8

39 files changed

+502
-427
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ jobs:
4646
- name: Autobuild
4747
uses: github/codeql-action/autobuild@v3
4848

49-
- name: Cache cleanup
49+
- name: Pip cache cleanup
5050
shell: bash
51+
# CODEQL_PYTHON is only defined if dependencies were installed [0]
52+
# [0] https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning?learn=code_security_actions&learnProduct=code-security#analyzing-python-dependencies
53+
if: ${{ env.CODEQL_PYTHON != '' }}
5154
run: |
5255
$CODEQL_PYTHON -m pip cache info
5356
$CODEQL_PYTHON -m pip cache purge

.github/workflows/pnl-ci-docs.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
echo "pip_cache_dir=$(python -m pip cache dir)" | tee -a $GITHUB_OUTPUT
9393
9494
- name: Wheels cache
95-
uses: actions/cache@v3
95+
uses: actions/cache@v4
9696
with:
9797
path: ${{ steps.pip_cache.outputs.pip_cache_dir }}/wheels
9898
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-${{ hashFiles('requirements.txt', 'doc_requirements.txt') }}-${{ github.sha }}
@@ -124,19 +124,21 @@ jobs:
124124
run: git tag -d 'v0.0.0.0'
125125

126126
- name: Upload Documentation
127-
uses: actions/upload-artifact@v3
127+
uses: actions/upload-artifact@v4
128128
with:
129129
name: Documentation-${{matrix.pnl-version}}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
130130
retention-days: 1
131131
path: docs/build/html
132132

133133
- name: Store PR number
134-
if: ${{ github.event_name == 'pull_request' }}
134+
# The 'base' variant runs only on pull requests and has only one job
135+
if: ${{ matrix.pnl-version == 'base' }}
135136
run: echo ${{ github.event.pull_request.number }} > ./pr_number.txt
136137

137138
- name: Upload PR number for other workflows
138-
if: ${{ github.event_name == 'pull_request' }}
139-
uses: actions/upload-artifact@v3
139+
# The 'base' variant runs only on pull requests and has only one job
140+
if: ${{ matrix.pnl-version == 'base' }}
141+
uses: actions/upload-artifact@v4
140142
with:
141143
name: pr_number
142144
path: ./pr_number.txt
@@ -168,7 +170,7 @@ jobs:
168170
ref: gh-pages
169171

170172
- name: Download branch docs
171-
uses: actions/download-artifact@v3
173+
uses: actions/download-artifact@v4
172174
with:
173175
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
174176
path: _built_docs/${{ github.ref }}
@@ -185,7 +187,7 @@ jobs:
185187
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'
186188

187189
- name: Download main docs
188-
uses: actions/download-artifact@v3
190+
uses: actions/download-artifact@v4
189191
with:
190192
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
191193
# This overwrites files in current directory

.github/workflows/pnl-ci.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
echo "pip_cache_dir=$(python -m pip cache dir)" | tee -a $GITHUB_OUTPUT
144144
145145
- name: Wheels cache
146-
uses: actions/cache@v3
146+
uses: actions/cache@v4
147147
with:
148148
path: ${{ steps.pip_cache.outputs.pip_cache_dir }}/wheels
149149
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-${{ hashFiles('requirements.txt', 'dev_requirements.txt') }}-${{ github.sha }}
@@ -163,22 +163,28 @@ jobs:
163163
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
164164
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
165165
166-
- name: Print test machine/env info
166+
- name: Print numpy info
167167
shell: bash
168168
run: |
169169
python -c "import numpy; numpy.show_config()"
170+
171+
- name: Print machine info
172+
shell: bash
173+
run: |
170174
case "$RUNNER_OS" in
171-
Linux*) lscpu;;
175+
Linux*) lscpu; lsmem;;
176+
macOS*) sysctl -a | grep '^hw' ;;
177+
Windows*) wmic cpu get description,currentclockspeed,NumberOfCores,NumberOfEnabledCore,NumberOfLogicalProcessors; wmic memorychip get capacity,speed,status,manufacturer ;;
172178
esac
173179
174180
- name: Test with pytest
175181
timeout-minutes: 180
176-
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto ${{ matrix.extra-args }}
182+
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n logical ${{ matrix.extra-args }}
177183

178184
- name: Upload test results
179-
uses: actions/upload-artifact@v3
185+
uses: actions/upload-artifact@v4
180186
with:
181-
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
187+
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ matrix.version-restrict }}
182188
path: tests_out.xml
183189
retention-days: 5
184190
if: (success() || failure()) && ! contains(matrix.extra-args, 'forked')
@@ -202,7 +208,8 @@ jobs:
202208
python setup.py sdist bdist_wheel
203209
204210
- name: Upload dist packages
205-
uses: actions/upload-artifact@v3
211+
uses: actions/upload-artifact@v4
212+
if: matrix.version-restrict == ''
206213
with:
207214
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
208215
path: dist/

.github/workflows/test-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
echo "wheel=$(ls *.whl)" >> $GITHUB_OUTPUT
3939
4040
- name: Upload Python dist files
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: Python-dist-files
4444
path: dist/
@@ -78,7 +78,7 @@ jobs:
7878

7979
steps:
8080
- name: Download dist files
81-
uses: actions/download-artifact@v3
81+
uses: actions/download-artifact@v4
8282
with:
8383
name: Python-dist-files
8484
path: dist/
@@ -126,7 +126,7 @@ jobs:
126126
pytest --junit-xml=tests_out.xml --verbosity=0 -n auto tests
127127
128128
- name: Upload test results
129-
uses: actions/upload-artifact@v3
129+
uses: actions/upload-artifact@v4
130130
with:
131131
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}
132132
path: tests_out.xml
@@ -141,7 +141,7 @@ jobs:
141141

142142
steps:
143143
- name: Download dist files
144-
uses: actions/download-artifact@v3
144+
uses: actions/download-artifact@v4
145145
with:
146146
name: Python-dist-files
147147
path: dist/
@@ -175,7 +175,7 @@ jobs:
175175

176176
steps:
177177
- name: Download dist files
178-
uses: actions/download-artifact@v3
178+
uses: actions/download-artifact@v4
179179
with:
180180
name: Python-dist-files
181181
path: dist/

broken_trans_deps.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,15 @@ cattrs != 23.1.1; python_version < '3.8'
2929
# cattrs==23.2.{1,2} breaks json serialization
3030
# https://github.com/python-attrs/cattrs/issues/453
3131
cattrs != 23.2.1, != 23.2.2
32+
33+
# The following need at least sphinx-5 without indicating it in dependencies:
34+
# * sphinxcontrib-applehelp >=1.0.8,
35+
# * sphinxcontrib-devhelp >=1.0.6,
36+
# * sphinxcontrib-htmlhelp >=2.0.5,
37+
# * sphinxcontrib-serializinghtml >=1.1.10,
38+
# * sphinxcontrib-qthelp >=1.0.7
39+
sphinxcontrib-applehelp <1.0.8
40+
sphinxcontrib-devhelp <1.0.6
41+
sphinxcontrib-htmlhelp <2.0.5
42+
sphinxcontrib-serializinghtml <1.1.10
43+
sphinxcontrib-qthelp <1.0.7

cuda_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pycuda >2018, <2023
1+
pycuda >2018, <2024

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
jupyter<1.0.1
22
packaging<24.0
3-
pytest<7.4.4
3+
pytest<8.0.1
44
pytest-benchmark<4.0.1
55
pytest-cov<4.1.1
66
pytest-forked<1.7.0

psyneulink/core/components/component.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ def _get_compilation_state(self):
13011301
"intensity"}
13021302
# Prune subcomponents (which are enabled by type rather than a list)
13031303
# that should be omitted
1304-
blacklist = { "objective_mechanism", "agent_rep", "projections"}
1304+
blacklist = { "objective_mechanism", "agent_rep", "projections", "shadow_inputs"}
13051305

13061306
# Only mechanisms use "value" state, can execute 'until finished',
13071307
# and need to track executions
@@ -1426,7 +1426,8 @@ def _get_compilation_params(self):
14261426
"randomization_dimension", "save_values", "save_samples",
14271427
"max_iterations", "duplicate_keys",
14281428
"search_termination_function", "state_feature_function",
1429-
"search_function",
1429+
"search_function", "weight", "exponent", "gating_signal_params",
1430+
"retain_old_simulation_data",
14301431
# not used in compiled learning
14311432
"learning_results", "learning_signal", "learning_signals",
14321433
"error_matrix", "error_signal", "activation_input",

psyneulink/core/components/functions/nonstateful/combinationfunctions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,8 @@ def _function(self,
14421442
elif operation == CROSS_ENTROPY:
14431443
v1 = variable[0]
14441444
v2 = variable[1]
1445-
combination = np.where(np.logical_and(v1 == 0, v2 == 0), 0.0, v1 * np.log(v2))
1445+
both_zero = np.logical_and(v1 == 0, v2 == 0)
1446+
combination = v1 * np.where(both_zero, 0.0, np.log(v2, where=np.logical_not(both_zero)))
14461447
else:
14471448
raise FunctionError("Unrecognized operator ({0}) for LinearCombination function".
14481449
format(operation.self.Operation.SUM))

psyneulink/core/components/functions/nonstateful/distributionfunctions.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import numpy as np
2828
from beartype import beartype
29+
from scipy.special import erfinv
2930

3031
from psyneulink._typing import Optional
3132

@@ -371,11 +372,6 @@ def _function(self,
371372
params=None,
372373
):
373374

374-
try:
375-
from scipy.special import erfinv
376-
except:
377-
raise FunctionError("The UniformToNormalDist function requires the SciPy package.")
378-
379375
mean = self._get_current_parameter_value(DIST_MEAN, context)
380376
standard_deviation = self._get_current_parameter_value(STANDARD_DEVIATION, context)
381377
random_state = self.parameters.random_state._get(context)

0 commit comments

Comments
 (0)