Skip to content

Commit 60f9add

Browse files
authored
Merge pull request #3271 from PrincetonUniversity/devel
Devel
2 parents f7b887a + 9be407d commit 60f9add

File tree

127 files changed

+8218
-3155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+8218
-3155
lines changed

.github/actions/install-pnl/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ runs:
7373
echo "llvmlite < 0.42.0" >> env_constraints.txt
7474
# matplotlib >=3.8.0 doesn't provide win32 wheel
7575
echo "matplotlib < 3.8.0" >> env_constraints.txt
76+
# fastkde >= 2.1.3 doesn't provide win32 wheel
77+
echo "fastkde < 2.1.3" >> env_constraints.txt
7678
fi
7779
7880
- name: Install updated package
@@ -109,6 +111,18 @@ runs:
109111
shell: bash
110112
run: |
111113
pip install ${{ steps.dist.outputs.wheel }}[${{ inputs.features }}] -c env_constraints.txt -c broken_trans_deps.txt
114+
env:
115+
# Setting CXXFLAGS works around a missing include that breaks the build
116+
# of onnx-1/17.0 on recent gcc/clang compilers.
117+
# This should be removed once onnx wheels for Python 3.13 are available.
118+
# Note that the MS Visual C equivalent option needs to start with an extra
119+
# space otherwise the argument gets interpreted as a file location.
120+
CXXFLAGS: ${{ startsWith(runner.os, 'windows') && ' /FI cstdint' || '-include cstdint' }}
121+
# Setting TEMP works around broken onnx-1.17.0 build on windows where
122+
# too long paths in default TEMP directory don't work with msbuild.
123+
# This should be removed once onnx wheels for Python 3.13 are available.
124+
# Note that $TEMP is only used to set pip's build location on Windows.
125+
TEMP: ${{ runner.temp }}
112126

113127
- name: Cleanup old wheels
114128
shell: bash

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- 'dependabot/**'
77
tags:
88
- 'v*'
9+
paths-ignore:
10+
- '.github/workflows/pnl-ci.yml'
911
pull_request:
1012

1113
# run only the latest instance of this workflow job for the current branch/PR
@@ -21,7 +23,7 @@ jobs:
2123
strategy:
2224
fail-fast: false
2325
matrix:
24-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
26+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
2527
os: [ubuntu-latest, macos-latest, windows-latest]
2628
pnl-version: ${{ (github.event_name == 'push') && fromJSON('["head"]') || fromJSON('["head", "base"]') }}
2729
exclude:
@@ -37,6 +39,8 @@ jobs:
3739
pnl-version: 'base'
3840
- python-version: '3.12'
3941
pnl-version: 'base'
42+
- python-version: '3.13'
43+
pnl-version: 'base'
4044

4145
outputs:
4246
on_master: ${{ steps.on_master.outputs.on-branch }}

.github/workflows/pnl-ci.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
python-version: ['3.8', '3.11', '3.12']
36+
python-version: ['3.8', '3.11', '3.12', '3.13']
3737
python-architecture: ['x64']
3838
extra-args: ['']
3939
os: [ubuntu, macos, windows]
@@ -138,11 +138,12 @@ jobs:
138138
- name: Lint with flake8
139139
shell: bash
140140
run: |
141-
pip install flake8
141+
pip install flake8 flake8-unused-arguments
142142
# stop the build if there are Python syntax errors or undefined names
143143
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
144144
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
145145
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
146+
flake8 --select=U100 --unused-arguments-ignore-stub-functions --unused-arguments-ignore-lambdas --unused-arguments-ignore-nested-functions --unused-arguments-ignore-variadic-names --extend-exclude tests/functions/test_user_defined_func.py tests/
146147
147148
- name: Print numpy info
148149
shell: bash
@@ -158,6 +159,24 @@ jobs:
158159
Windows*) wmic cpu get description,currentclockspeed,NumberOfCores,NumberOfEnabledCore,NumberOfLogicalProcessors; wmic memorychip get capacity,speed,status,manufacturer ;;
159160
esac
160161
162+
# Windows runners use MS Edge as the default pdf viewer.
163+
# This causes issues if any of the tests calls show_graph()
164+
# or any other routine that by default produces a .pdf file
165+
# and opens is in the default application.
166+
# The problem with MS Edge is that it intermittently fails
167+
# to exit and hangs the entire CI job in the last step.
168+
# see: https://github.com/actions/runner/issues/3383
169+
# Removing the default .pdf file association on windows is
170+
# quite difficult because it needs to check multiple places
171+
# and elevated privileges.
172+
# Installing an alternative pdf viewer works around the issue
173+
# as it prevents MS Edge from running when .pdf is displayed.
174+
- name: Install windows pdf viewer
175+
shell: bash
176+
if: ${{ matrix.os == 'windows' }}
177+
run: |
178+
choco install --no-progress -y sumatrapdf.install
179+
161180
- name: Test with pytest
162181
timeout-minutes: 180
163182
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n logical --capture=sys -o console_output_style=count ${{ matrix.extra-args }}
@@ -188,5 +207,14 @@ jobs:
188207
if: matrix.version-restrict == ''
189208
with:
190209
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
191-
path: ${{ steps.install.outputs.wheel }} ${{ steps.install.outputs.sdist }}
210+
path: |
211+
${{ steps.install.outputs.wheel }}
212+
${{ steps.install.outputs.sdist }}
192213
retention-days: 2
214+
215+
# this step is kept for debugging hangs at the end of runner execution.
216+
- name: List running processes
217+
shell: pwsh
218+
if: ${{ matrix.os == 'windows' }}
219+
run: |
220+
Get-Process;

.github/workflows/test-release.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,34 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Install setup dependencies
29+
shell: bash
30+
run: pip install build twine
31+
2832
- name: Create Python Dist files
2933
id: create_dist
3034
shell: bash
3135
run: |
3236
# We don't care about the python version used.
33-
pip install setuptools wheel
34-
python setup.py sdist
35-
python setup.py bdist_wheel
37+
python -m build -v
3638
cd dist
3739
echo "sdist=$(ls *.tar.gz)" >> $GITHUB_OUTPUT
3840
echo "wheel=$(ls *.whl)" >> $GITHUB_OUTPUT
3941
4042
- name: Upload Python dist files
4143
uses: actions/upload-artifact@v4
4244
with:
43-
name: Python-dist-files
45+
name: psyneulink-${{ github.ref_name }}-dist
4446
path: dist/
45-
retention-days: 1
47+
retention-days: 30
48+
49+
- name: Validate dist files
50+
shell: bash
51+
run: twine check --strict dist/*
4652

4753
- name: Upload dist files to test PyPI
4854
shell: bash
4955
run: |
50-
# Include implicit dependency on setuptools{,-rust} and preinstall wheel
51-
pip install setuptools setuptools-rust wheel
52-
pip install twine
5356
# This expects TWINE_USERNAME, TWINE_PASSWORD, and TWINE_REPOSITORY_URL
5457
# environment variables
5558
# It's not possible to condition steps on env or secrets,
@@ -69,7 +72,7 @@ jobs:
6972
strategy:
7073
fail-fast: false
7174
matrix:
72-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
75+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
7376
os: [ubuntu-latest, macos-latest, windows-latest]
7477
dist: [wheel, sdist]
7578

@@ -80,7 +83,7 @@ jobs:
8083
- name: Download dist files
8184
uses: actions/download-artifact@v4
8285
with:
83-
name: Python-dist-files
86+
name: psyneulink-${{ github.ref_name }}-dist
8487
path: dist/
8588

8689
- name: Set up Python ${{ matrix.python-version }}
@@ -118,7 +121,7 @@ jobs:
118121
- name: Run tests
119122
shell: bash
120123
# run only tests/. We don't care about codestyle/docstyle at this point
121-
timeout-minutes: 80
124+
timeout-minutes: 180
122125
run: |
123126
# remove sources to prevent conflict with the isntalled package
124127
rm -r -f psyneulink/ docs/ bin/ Matlab/
@@ -143,15 +146,20 @@ jobs:
143146
- name: Download dist files
144147
uses: actions/download-artifact@v4
145148
with:
146-
name: Python-dist-files
149+
name: psyneulink-${{ github.ref_name }}-dist
147150
path: dist/
148151

152+
- name: Install setup dependencies
153+
shell: bash
154+
run: pip install twine
155+
156+
- name: Validate dist files
157+
shell: bash
158+
run: twine check --strict dist/*
159+
149160
- name: Upload dist files to PyPI
150161
shell: bash
151162
run: |
152-
# Include implicit dependency on setuptools{,-rust} and preinstall wheel
153-
pip3 install --user setuptools setuptools-rust wheel
154-
pip3 install --user twine
155163
# This expects TWINE_USERNAME, TWINE_PASSWORD, and TWINE_REPOSITORY_URL
156164
# environment variables
157165
# It's not possible to condition steps on env or secrets,
@@ -177,13 +185,17 @@ jobs:
177185
- name: Download dist files
178186
uses: actions/download-artifact@v4
179187
with:
180-
name: Python-dist-files
188+
name: psyneulink-${{ github.ref_name }}-dist
181189
path: dist/
182190

183191
- name: Upload dist files to release
184192
shell: bash
185193
env:
186194
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187195
run: |
188-
previous_release=$(gh --repo ${{ github.repository }} release list | head -n 1 | awk '{print $1}')
189-
gh --repo ${{ github.repository }} release create --generate-notes --notes-start-tag "$previous_release" ${{ github.ref }} dist/*
196+
previous_release=$(gh --repo ${{ github.repository }} release list -L 1 | cut -f1)
197+
if [[ -z "$previous_release" ]]; then
198+
echo "No previous release found"
199+
exit 1
200+
fi
201+
gh --repo ${{ github.repository }} release create --generate-notes --notes-start-tag "$previous_release" ${{ github.ref_name }} dist/*

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ recursive-include tests *.py
88
recursive-include tutorial *.ipynb
99
include versioneer.py
1010
include psyneulink/_version.py
11+
12+
include psyneulink/library/models/results/*.json

README.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
.. image:: https://badge.fury.io/py/psyneulink.svg
1+
.. |pypi-badge| image:: https://badge.fury.io/py/psyneulink.svg
22
:target: https://badge.fury.io/py/psyneulink
3-
.. image:: https://github.com/PrincetonUniversity/PsyNeuLink/workflows/PsyNeuLink%20CI/badge.svg?branch=master
3+
4+
.. |build-badge| image:: https://github.com/PrincetonUniversity/PsyNeuLink/workflows/PsyNeuLink%20CI/badge.svg?branch=master
45
:target: https://github.com/PrincetonUniversity/PsyNeuLink/actions
5-
.. image:: https://mybinder.org/badge.svg
6+
7+
.. |binder-badge| image:: https://mybinder.org/badge.svg
68
:target: https://mybinder.org/v2/gh/PrincetonUniversity/PsyNeuLink/master
79

10+
|pypi-badge| |build-badge| |binder-badge|
11+
812
.. *****************************************************************************************
913
.. ****** NOTE: UPDATES TO THIS PAGE SHOULD ALSO BE MADE TO docs/source.index.rst *********
1014
.. *****************************************************************************************
@@ -46,7 +50,7 @@ It is:
4650

4751
..
4852
49-
- *computationally general* -- it can be used to implement, seamlessly integrate, and simulate interactions among
53+
- *computationally general* -- it can be used to implement, seamlessly integrate, and simulate interactions among
5054
disparate components that vary in their granularity of representation and function (from individual neurons or
5155
neural populations to functional subsystems and abstract cognitive functions) and at any time scale of execution.
5256

@@ -85,7 +89,7 @@ it is presently less well suited to efforts involving massively large computatio
8589

8690
Other packages currently better suited to such applications are:
8791
`Emergent <https://grey.colorado.edu/emergent/index.php/Main_Page>`_ for biologically-inspired neural network models
88-
`Pytorch <https://pytorch.org>`_ and `TensorFlow <https://www.tensorflow.org>`_ (for deep learning models);
92+
`Pytorch <pytorch_>`_ and `TensorFlow <https://www.tensorflow.org>`_ (for deep learning models);
8993
`HDDM <http://ski.clps.brown.edu/hddm_docs/>`_ (for Drift Diffusion Models);
9094
`ACT-R <http://act-r.psy.cmu.edu>`_ (for production system models);
9195
`Genesis <http://www.genesis-sim.org>`_,
@@ -102,7 +106,7 @@ That said, priorities for ongoing development of PsyNeuLink are:
102106
i) acceleration, using just-in-time compilation methods and parallelization
103107
(see `Compilation`, and `Vesely et al., 2022 <http://www.cs.yale.edu/homes/abhishek/jvesely-cgo22.pdf>`_);
104108
ii) enhancement of the API to facilitate wrapping modules from other packages for integration into the PsyNeuLink
105-
environment (examples currently exist for `Pytorch <https://pytorch.org>`_ ) and translating into a standard
109+
environment (examples currently exist for `Pytorch <pytorch_>`_) and translating into a standard
106110
`Model Description Format (MDF) <https://github.com/ModECI/MDF>`_;
107111
iii) integration of tools for parameter estimation, model comparison and data fitting
108112
(see `ParameterEstimationComposition`); and
@@ -254,3 +258,5 @@ License
254258
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
255259
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
256260
See the License for the specific language governing permissions and limitations under the License.
261+
262+
.. _pytorch: https://pytorch.org

Scripts/Examples/Rumelhart Semantic Network.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
# Representation_Input (REP_IN)
2020

2121
# Construct Mechanisms
22-
rep_in = TransferMechanism(input_shapes=10, name='REP_IN')
23-
rel_in = TransferMechanism(input_shapes=11, name='REL_IN')
24-
rep_hidden = TransferMechanism(input_shapes=4, function=Logistic, name='REP_HIDDEN')
25-
rel_hidden = TransferMechanism(input_shapes=5, function=Logistic, name='REL_HIDDEN')
26-
rep_out = TransferMechanism(input_shapes=10, function=Logistic, name='REP_OUT')
27-
prop_out = TransferMechanism(input_shapes=12, function=Logistic, name='PROP_OUT')
28-
qual_out = TransferMechanism(input_shapes=13, function=Logistic, name='QUAL_OUT')
29-
act_out = TransferMechanism(input_shapes=14, function=Logistic, name='ACT_OUT')
22+
rep_in = ProcessingMechanism(input_shapes=10, name='REP_IN')
23+
rel_in = ProcessingMechanism(input_shapes=11, name='REL_IN')
24+
rep_hidden = ProcessingMechanism(input_shapes=4, function=Logistic, name='REP_HIDDEN')
25+
rel_hidden = ProcessingMechanism(input_shapes=5, function=Logistic, name='REL_HIDDEN')
26+
rep_out = ProcessingMechanism(input_shapes=10, function=Logistic, name='REP_OUT')
27+
prop_out = ProcessingMechanism(input_shapes=12, function=Logistic, name='PROP_OUT')
28+
qual_out = ProcessingMechanism(input_shapes=13, function=Logistic, name='QUAL_OUT')
29+
act_out = ProcessingMechanism(input_shapes=14, function=Logistic, name='ACT_OUT')
3030

3131
# Construct Composition
3232
comp = Composition(name='Rumelhart Semantic Network')

0 commit comments

Comments
 (0)