Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indep_sessions standardization is not working #19

Open
itsMig opened this issue Sep 20, 2023 · 1 comment
Open

indep_sessions standardization is not working #19

itsMig opened this issue Sep 20, 2023 · 1 comment

Comments

@itsMig
Copy link

itsMig commented Sep 20, 2023

Hi @mdaeron,
I didn't notice so far since we almost entirely use the pooled approach, but self.standardize(method='indep_sessions') is not working for me after updating D47crunch .

Python v3.9.6
D47crunch v2.3.2

import D47crunch
mydata = D47crunch.D47data()
mydata.read('rawdata.csv')
mydata.wg()
mydata.crunch()
mydata.standardize(method = 'indep_sessions')
Traceback (most recent call last):
  File ".../TESTING_D47crunch/test.py", line 14, in <module>
    mydata.standardize(
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 957, in newfun
    out = oldfun(*args, **kwargs)
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 1757, in standardize
    self.consolidate(tables = consolidate_tables, plots = consolidate_plots)
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 957, in newfun
    out = oldfun(*args, **kwargs)
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 2322, in consolidate
    self.consolidate_sessions()
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 2215, in consolidate_sessions
    self.sessions[session][f'r_D{self._4x}'] = self.compute_r(f'D{self._4x}', sessions = [session])
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 957, in newfun
    out = oldfun(*args, **kwargs)
  File ".../TESTING_D47crunch/venv/lib/python3.9/site-packages/D47crunch/__init__.py", line 2399, in compute_r
    _ for _ in self.standardization.params
AttributeError: 'D47data' object has no attribute 'standardization'
@mdaeron
Copy link
Owner

mdaeron commented Sep 20, 2023

Yuck. I knew supporting indep_sessions would end up being a pain.

Short term solution: I'll try to debug this particular error.

Long-term solution: choose between

(1) deprecating, then removing indep_sessions entirely, leaving an example to mimic the old behavior:

data.split_samples(grouping = 'by_session')`
data.standardize()
data.unsplit_samples()

(2) keep indep_sessions but transparently implement it as in the above example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants