Skip to content

bugfix for timeseries2velocity.py --bootstrap --save-res#733

Merged
yunjunz merged 2 commits intomainfrom
olliestephenson-patch-1
Jan 28, 2022
Merged

bugfix for timeseries2velocity.py --bootstrap --save-res#733
yunjunz merged 2 commits intomainfrom
olliestephenson-patch-1

Conversation

@olliestephenson
Copy link
Copy Markdown
Contributor

@olliestephenson olliestephenson commented Jan 28, 2022

When running timeseries2velocity.py with bootstrapping, we use the function time_func.estimate_time_func to repeatedly fit the time series data. This function returns the design matrix, G, however when bootstrapping we don't assign the design matrix to a variable, meaning that if we try to save the residual file we get the error UnboundLocalError: local variable 'G' referenced before assignment at line 702.

Related to #654

Description of proposed changes

If we want to output the residual when bootstrapping, we need to get the full design matrix. I've added a line of code to do this.

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.

olliestephenson and others added 2 commits January 27, 2022 20:09
When running `timeseries2velocity.py` with bootstrapping, we use the function `time_func.estimate_time_func` to repeatedly fit the time series data. This function returns the design matrix, `G`,  however when bootstrapping we don't assign the design matrix to a variable, meaning that if we try to save the residual file we get the error `UnboundLocalError: local variable 'G' referenced before assignment` at line 702.

If we want to output the residual when bootstrapping, we need to get the full design matrix. I've added a line of code to do this.
@yunjunz yunjunz changed the title Bux fix in timeseries2velocity.py bugfix for timeseries2velocity.py --bootstrap --save-res Jan 28, 2022
@yunjunz yunjunz requested review from yuankailiu and yunjunz and removed request for yuankailiu January 28, 2022 04:42
Copy link
Copy Markdown
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @olliestephenson.

@yunjunz yunjunz merged commit d219448 into main Jan 28, 2022
@yunjunz yunjunz deleted the olliestephenson-patch-1 branch January 28, 2022 05:55
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

Successfully merging this pull request may close these issues.

2 participants