Skip to content

Commit 20a4ec7

Browse files
committed
count last frame in when measuring the close_time
1 parent 6fbeb6a commit 20a4ec7

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"sphinx.ext.autodoc", # Auto pull docstrings
3333
"sphinx.ext.napoleon", # Google/Numpy style docstrings
3434
"sphinx_autodoc_typehints", # Type hints in docs
35+
"sphinx.ext.viewcode",
36+
"sphinx.ext.githubpages",
3537
]
3638

3739
# Allow both .rst and .md files

psyflow/StimUnit.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -488,24 +488,32 @@ def show(
488488
self.set_state(flip_time=flip_time)
489489

490490
# --- Frame-based visual presentation ---
491-
tclock = core.Clock()
492-
tclock.reset()
493-
494491
visual_stims = [s for s in self.stimuli if hasattr(s, "draw") and callable(s.draw)]
495492
n_frames = int(round(t_val / self.frame_time))
496493

497494
for frame_i in range(n_frames - 1):
498495
for stim in visual_stims:
499496
stim.draw()
500-
if frame_i == n_frames - 2:
501-
self.win.callOnFlip(
502-
self.set_state,
503-
offset_trigger=offset_trigger,
504-
close_time=self.clock.getTime(),
505-
close_time_global=core.getAbsTime()
506-
)
507-
self.win.callOnFlip(self.send_trigger, offset_trigger)
497+
# if frame_i == n_frames - 2: # if it is the last frame, schedule the offset
498+
# self.win.callOnFlip(
499+
# self.set_state,
500+
# offset_trigger=offset_trigger,
501+
# close_time=self.clock.getTime(),
502+
# close_time_global=core.getAbsTime()
503+
# )
504+
# self.win.callOnFlip(self.send_trigger, offset_trigger)
508505
self.win.flip()
506+
self.set_state(
507+
close_time=self.clock.getTime(),
508+
close_time_global=core.getAbsTime()
509+
)
510+
self.send_trigger(offset_trigger)
511+
# self.set_state,
512+
# offset_trigger=offset_trigger,
513+
# close_time=self.clock.getTime(),
514+
# close_time_global=core.getAbsTime()
515+
# )
516+
# self.win.callOnFlip(self.send_trigger, offset_trigger)
509517

510518
self.log_unit()
511519
return self

psyflow/templates/task2doc_prompt.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ For each section below, include every detail—parameters, timings, flow logic,
1111

1212
**IMPORTANT TABLE FORMATTING RULES (apply to every table in sections 1–4):**
1313
1. Always start with a header row and a separator row, for example:
14-
2. After the separator row, include **one blank line** before listing data rows.
15-
3. Do **not** omit the blank line—this ensures the table closes properly.
16-
4. Do **not** add extra pipes or indentation.
14+
2. Do **not** omit the blank line—this ensures the table closes properly.
15+
3. Do **not** add extra pipes or indentation.
1716

1817
# Task Name
1918
Extract the full task name and use it as the document’s top-level heading.
2019

2120
## (Meta Information) we don't need the meta information as header, we just show table
22-
• Render as a Markdown table with two columns: Field and Value.
23-
• Include this header and separator row exactly, then a blank line:
21+
• Render as a Markdown table with two columns: Field and Value.
22+
• Include this header and separator row exactly
2423
| Field | Value |
2524
|----------------------|------------------------------|
2625

@@ -30,9 +29,10 @@ Extract the full task name and use it as the document’s top-level heading.
3029
- URL / Repository
3130
- Short Description
3231
- Created By
33-
- Date Created
32+
- Date Updated
3433
- PsyFlow Version
3534
- PsychoPy Version
35+
Try your best to fill the table, if you are not sure leave them as blank.
3636

3737
## 1. Task Overview
3838
• One concise paragraph summarizing the goal and design of the task.

0 commit comments

Comments
 (0)