Skip to content

Commit

Permalink
Merge branch 'release' of https://github.com/psychopy/psychopy into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
peircej committed Jun 5, 2023
2 parents 46d265d + 20ded07 commit 4ecc8d7
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 57 deletions.
2 changes: 1 addition & 1 deletion docs/source/about/testimonials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Testimonials - what do people think of |PsychoPy|?
=====================================================

OK, so we know that `PsychoPy has quite a lot of users <https://www.psychopy.org/usage.php>`_
OK, so we know that `PsychoPy has quite a lot of users <https://usage.psychopy.org>`_

We also know that quite a few people have written `manuscripts that cited |PsychoPy|
<http://scholar.google.co.uk/scholar?cites=18194791051729814045&as_sdt=2005&sciodt=0,5&hl=en>`_
Expand Down
1 change: 0 additions & 1 deletion docs/source/api/visual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Shapes (all special classes of :class:`ShapeStim`):

Images and patterns:

* :class:`.ImageStim` to show images
* :class:`.SimpleImageStim` to show images without bells and whistles
* :class:`.GratingStim` to show gratings
* :class:`.RadialStim` to show annulus, a rotating wedge, a checkerboard etc
Expand Down
2 changes: 1 addition & 1 deletion docs/source/resources/vss-workshop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
VSS 2012 Satellite Event, May 2012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PsychoPy is a modern, powerful easy-to-use software package for conducting psychophysics and imaging studies. It's become the package of choice in thousands of labs worldwide (see https://www.psychopy.org/usage.php).
PsychoPy is a modern, powerful easy-to-use software package for conducting psychophysics and imaging studies. It's become the package of choice in thousands of labs worldwide (see https://usage.psychopy.org ).

Using the Python programming language (a more powerful and free alternative to Matlab) PsychoPy can generate your stimuli in real-time and collect responses with high temporal precision.

Expand Down
34 changes: 34 additions & 0 deletions psychopy/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,40 @@ PsychoPy 2023.1
bubble (lab-based only, currently)
- **MovieStim:** further improvements to performance and fixes

On top of the [new features added in 2023.1 series](https://github.com/psychopy/psychopy/releases/tag/2023.1.0)

## Fixes

* Fix crash following gamma semi-auto correction (when laying out dialog box) dialog box by @TEParsons in #5452
* Crashing due to outdated `core.getFromNames` in Mouse by @TEParsons in #5474
* Setting Image as a numpy array caused a TypeError by @TEParsons in #5453
* Handle invalid paths when stringifying params by @TEParsons in #5465
* Swap all references to Panorama.altitude with Panorama.elevation by @TEParsons in #5471
* Fix typo in Survey routine - `stauts` rather than `status` by @TEParsons in #5468
* If user requests showing README and there isn't one then show a blank file @TEParsons in #5470
* Fix typos in high contrast theme by @TEParsons in #5504
* Sound files online were playing forever if duration set to <0.5s by @TEParsons in #5466
* Let Builder treat Sound.isPlaying and Sound.status==STARTED as synonymous by @TEParsons in #5428
* Correctly ignore blank columns by @wader in #5406
* Viewport was left as None when checkTiming was unticked by @TEParsons in #5451
* Better handling when a Pavlovia project / plugin avatars in the app @TEParsons in #5458 #5460 #5469

## Documentation fixes by

* @roelofsaj in #5477 #5483 #5484
* @ChenBri in #5478 #5480
* @ChristopheBossens in #5481
* @suelynnmah in #5444

## New Contributors

* @roelofsaj made their first contribution in #5477
* @ChenBri made their first contribution in #5478
* @ChristopheBossens made their first contribution in #5481
* @wader made their first contribution in #5406

**Full Changelog**: https://github.com/psychopy/psychopy/compare/2023.1.1...2023.1.2

PsychoPy 2023.1.1
~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 3 additions & 3 deletions psychopy/app/Resources/tips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Coder: you can click the color-picker icon on the toolbar. The R,G,B color tripl
If you have a tip that you'd like to added here, email it to the users list.
To flip an image stimulus, give it a negative 'size', in x, y or both
PsychoPy is free. Please cite the most recent paper (Peirce et al 2019) if you use PsychoPy in published work
Builder: To set stimulus position to your variables X and Y, you can use either $[X,Y] or [$X,$Y]. (A $ anywhere indicates that the entire entry box is Python code)
Builder: To set stimulus position to your variables X and Y, you can use either $[X,Y] or [$X,Y]. (A $ anywhere indicates that the entire entry box is Python code)
You should wear sunscreen. (Where does it say these tips have to be original?!)
In Python, the values True and False must have capitals and really just stand for 1 and 0.
Builder: The contents of the dialog box at the start of your experiment are controlled from the Experiment Settings button. You can use these values in your study by referring to the value in expInfo e.g. expInfo['participant']
Coder: You can comment/uncomment entire blocks of code with Ctrl-' and Ctrl-Shift-'
Did your stimulus not appear? Was it really tiny? Setting units='pix' and size=0.1 means it has a size of 0.1 pixels!
The default color values in PsychoPy range from -1 to +1, with 0 being the mean grey of the screen. So black is like the maximum decrement from grey and white is an increment. Right?
Data can be output in many different formats, but it's worth saving the 'psydat' (aka pickle) format as well as the others. Although this isn't "human readable" it stores more information than excel/csv files including an entire copy of your actual experiment!
You can see how many people used PsychoPy this month at https://www.psychopy.org/usage.php
You can see how many people used PsychoPy this month at https://usage.psychopy.org
Builder: You can increase or decrease the display size of the flow using "Ctrl + =" or "Ctrl + -" (like some web browsers). Similarly, you can change the display size of routines using "Ctrl + Shift + =" and "Ctrl + Shift + -". (Use "Cmd" on Mac, not "Ctrl".)
In the Builder, you can display details about the trials and sequences of loops. Press "Ctrl + =" when at the largest view size. To turn off, press "Ctrl + -" from the smallest view size.
Builder: To put a $ symbol in a stimulus, you need to use \$, like this: "You win \$5.00!". (This is only for input boxes, and not for code components.)
Expand All @@ -42,4 +42,4 @@ The Keyboard class has better timing than event.getKeys() and also reports key d
Get your department to buy a site licence for Pavlovia.org. You'll be helping fund PsychoPy development and you'll be able to run unlimited online studies.
Coder: Can't remember arguments for a class or function? Use "Ctrl + Shift + Space" after the first brace to bring up a calltip. Press "Esc" or "Enter" to close it.
Coder: Use "Ctrl + Space" to bring up a list of code completion suggestions. Press "Enter" to insert the selected suggestion into your code or "Esc" to cancel.
Coder: The "Code Structure" pane shows an outline of classes and functions defined in the current file. Click on items to go to where they are defined.
Coder: The "Code Structure" pane shows an outline of classes and functions defined in the current file. Click on items to go to where they are defined.
2 changes: 1 addition & 1 deletion psychopy/app/Resources/tips_ja_JP.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
 刺激が表示されなくて困っていませんか? 刺激の単位をpixに変更したのにサイズを0.1のままにしていると大きさがたったの0.1ピクセルになってしまいますよ!
 PsychoPyでは色のRGB値を-1.0から1.0で表します。RGB値がすべて0.0なら灰色、-1.0なら黒、1.0なら白です。
 データはさまざまな形式で出力できますが、psydat(pickle形式)ファイルはPythonユーザーにとってはとても便利です。直接エディタで開いて読むことは出来ませんが、実験条件ファイルを含む実験の全ての情報のコピーが保存されています。
 PsychoPyの月別利用者数を https://www.psychopy.org/usage.php で見ることが出来ます。
 PsychoPyの月別利用者数を https://usage.psychopy.org で見ることが出来ます。
 Builderでは Ctrl + = または Ctrl + -でFlowのアイコンの大きさを変更できます。同様に、Ctrl + Shift + =とCtrl + Shift + -でRoutineのアイコンの大きさを変更できます。(Macの人はCtrlの代わりにCmdキーを使いましょう)
 Builderでフローの表示サイズが最大の時にCtrl + =を押すとループやルーチンの詳細が表示されます。表示サイズが最小の時にCtrl + -を押すと表示されなくなります。
 Builderで"You win \$5.00!"のように$記号を含む文字列を表示したい場合は、$の前に\を付けて\$と書くに必要があります。ただしCodeコンポーネントでは必要ありません。
Expand Down
2 changes: 1 addition & 1 deletion psychopy/app/_psychopyApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def onInit(self, showSplash=True, testMode=False, safeMode=False):
for exp in [file for file in args if file.endswith('.psyexp') or file.endswith('.py')]:
self.runner.panel.runFile(exp)

# send anonymous info to www.psychopy.org/usage.php
# send anonymous info to https://usage.psychopy.org
# please don't disable this, it's important for PsychoPy's development
self._latestAvailableVersion = None
self.updater = None
Expand Down
6 changes: 5 additions & 1 deletion psychopy/app/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def updateReadme(self, show=None):
If None, show only when there is content.
"""
# Make sure we have a file
if self.filename and self.filename != 'untitled.psyexp':
if self.filename:
dirname = Path(self.filename).parent
possibles = list(dirname.glob('readme*'))
if len(possibles) == 0:
Expand All @@ -887,6 +887,10 @@ def updateReadme(self, show=None):
parent=self, filename=self.readmeFilename
)

# Set file
self.readmeFrame.file = self.readmeFilename
self.readmeFrame.load()

# Show/hide frame as appropriate
if show is None:
show = len(self.readmeFrame.ctrl.getValue()) > 0
Expand Down
1 change: 1 addition & 0 deletions psychopy/app/coder/sourceTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def refresh(self):
# work out which keyword the line starts with
kwrd = None
for i in kwrds:
i += " " # add a space to avoid e.g. `defaultKeyboard` being read as a keyword
if lineText.startswith(i):
kwrd = i
# skip if it starts with no keywords
Expand Down
2 changes: 1 addition & 1 deletion psychopy/app/connections/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def sendUsageStats():
systemInfo = "win32_v" + platform.version()
else:
systemInfo = platform.system() + platform.release()
u = "https://www.psychopy.org/usage.php?date=%s&sys=%s&version=%s&misc=%s"
u = "https://usage.psychopy.org/submit.php?date=%s&sys=%s&version=%s&misc=%s"
URL = u % (dateNow, systemInfo, v, miscInfo)
try:
req = urllib.request.Request(URL)
Expand Down
17 changes: 14 additions & 3 deletions psychopy/app/plugin_manager/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,25 @@ def __init__(self, parent):
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.border.Add(self.sizer, proportion=1, border=12, flag=wx.ALL | wx.EXPAND)

# Sanitize system executable
executable = sys.executable
if not (
executable[0] in ("'", '"') and executable[-1] in ("'", '"')
):
executable = f'"{executable}"'
# Construct preface
self.preface = " ".join([executable, "-m"])
# Add output
self.output = wx.richtext.RichTextCtrl(
self,
value=_translate(
"Type a PIP command below and press Enter to execute it in the installed PsychoPy environment, any "
"returned text will appear below.\n"
"\n"
),
"All commands will be automatically prefaced with:\n"
"{}\n"
"\n"
).format(self.preface),
size=(480, -1),
style=wx.TE_READONLY)
self.sizer.Add(self.output, proportion=1, border=6, flag=wx.ALL | wx.EXPAND)
Expand Down Expand Up @@ -91,7 +102,7 @@ def onEnter(self, evt=None):

def runCommand(self, cmd):
"""Run the command."""
emts = [sys.executable, "-m", cmd]
emts = [self.preface, cmd]
output = sp.Popen(' '.join(emts),
stdout=sp.PIPE,
stderr=sp.PIPE,
Expand Down Expand Up @@ -277,7 +288,7 @@ def onAddFromFile(self, evt=None):
# Create dialog to get package file location
dlg = wx.FileDialog(
self,
wildcard="Wheel files (.whl)|.whl|Source distribution files (.sdist)|.sdist",
wildcard="Wheel files (*.whl)|*.whl|Source distribution files (*.sdist)|*.sdist|All files (*.*)|*.*",
style=wx.FD_OPEN | wx.FD_SHOW_HIDDEN)
if dlg.ShowModal() == wx.ID_OK:
# Install
Expand Down
6 changes: 3 additions & 3 deletions psychopy/app/psychopyApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@


def start_app():
from psychopy.app import startApp
from psychopy.app import startApp, quitApp

showSplash = True
if '--no-splash' in sys.argv:
showSplash = False
del sys.argv[sys.argv.index('--no-splash')]
app = startApp(showSplash=showSplash)
app.MainLoop()
_ = startApp(showSplash=showSplash) # main loop
quitApp()


def main():
Expand Down
21 changes: 11 additions & 10 deletions psychopy/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,20 +553,21 @@ def toggleView(self, evt=True):
def render(self, evt=None):
# Render HTML
if md:
renderedText = md.MarkdownIt().render(self.rawTextCtrl.Value)
# Remove images (wx doesn't like rendering them)
imgBuffer = renderedText.split("<img ")
# get raw text
rawText = self.rawTextCtrl.Value
# remove images (wx doesn't like rendering them)
imgBuffer = rawText.split("![")
output = []
for cell in imgBuffer:
if "/>" in cell:
output.extend(cell.split("/>")[1:])
elif "</img>" in cell:
output.extend(cell.split("</img>")[1:])
if ")" in cell:
output.extend(cell.split(")")[1:])
else:
output.append(cell)
renderedText = "".join(imgBuffer)
# This could also be done by regex, we're avoiding regex for
# renderedText = re.sub(r"<img[\s>].*(?:\/>|<\/img>)", "", renderedText)
rawText = "".join(output)
# This could also be done by regex, we're avoiding regex for readability
# rawText = re.sub(r"\!\[.*\]\(.*\)", "", rawText)
# render markdown
renderedText = md.MarkdownIt("default-js").render(rawText)
else:
renderedText = self.rawTextCtrl.Value.replace("\n", "<br>")
# Apply to preview ctrl
Expand Down
9 changes: 9 additions & 0 deletions psychopy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,12 @@ def shellCall(shellCmd, stdin='', stderr=False, env=None, encoding=None):
return stdoutData.strip(), stderrData.strip()
else:
return stdoutData.strip()


class ComponentPlaceholder:
"""
When a component is not implemented, we need an object to represent it when running, which will accept any
attribute given without causing an error and breaking the experiment. This object extends the base Python
`object` class, with no additions.
"""
pass
2 changes: 1 addition & 1 deletion psychopy/experiment/components/brush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def writeInitCode(self, buff):
" lineColor={lineColor},\n"
" lineColorSpace={lineColorSpace},\n"
" opacity={opacity},\n"
" buttonRequired={buttonRequired}\n"
" buttonRequired={buttonRequired},\n"
" depth={depth}\n"
")"
).format(**inits)
Expand Down
Loading

0 comments on commit 4ecc8d7

Please sign in to comment.