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

[pre-commit.ci] pre-commit autoupdate #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Aug 12, 2024

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 3aa7526 to 7f3b5ec Compare August 12, 2024 17:26
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 7f3b5ec to a7808d4 Compare August 19, 2024 17:27
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from f172de2 to 30879da Compare September 2, 2024 17:28
Copy link
Member

@twiecki twiecki left a comment

Choose a reason for hiding this comment

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

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1
- files were modified by this hook

notebooks/pytensor_logp.ipynb:cell 9:2:89: E501 Line too long (89 > 88)
  |
1 | %%time
2 | # The compilation time is pretty bad right now, I think this can be improved a lot though
  |                                                                                         ^ E501
3 | compiled_model = nutpie.compile_pymc_model(pymc_model)
  |

notebooks/pytensor_logp.ipynb:cell 19:2:6: PTH123 `open()` should be replaced by `Path.open()`
  |
1 | %%time
2 | with open("radon_model.stan") as file:
  |      ^^^^ PTH123
3 |     model = stan.build(file.read(), data=data_stan)
  |

notebooks/pytensor_logp.ipynb:cell 25:1:89: E501 Line too long (168 > 88)
  |
1 | plt.plot((trace_pymc.warmup_sample_stats.n_steps).isel(draw=slice(0, 1000)).cumsum("draw").T, np.log(trace_pymc.warmup_sample_stats.energy.isel(draw=slice(0, 1000)).T))
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
2 | plt.xlim(0, 10000)
3 | plt.ylabel("log-energy")
  |

notebooks/pytensor_logp.ipynb:cell 27:1:89: E501 Line too long (174 > 88)
  |
1 | plt.plot((trace_cmdstan.warmup_sample_stats.n_steps).isel(draw=slice(0, 1000)).cumsum("draw").T, np.log(trace_cmdstan.warmup_sample_stats.energy.isel(draw=slice(0, 1000)).T))
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
2 | plt.xlim(0, 10000)
3 | plt.ylabel("log-energy")
  |

notebooks/pytensor_logp.ipynb:cell 35:1:89: E501 Line too long (113 > 88)
  |
1 | type({name: int(val) if isinstance(val, int) else list(val) for name, val in data_stan.items()}["county_idx"][0])
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ E501
  |

notebooks/pytensor_logp.ipynb:cell 36:8:27: C400 Unnecessary generator (rewrite as a `list` comprehension)
  |
7 |     if val.dtype == np.int64:
8 |         data_json[name] = list(int(x) for x in val)
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ C400
9 |         continue
  |
  = help: Rewrite as a `list` comprehension

notebooks/pytensor_logp.ipynb:cell 36:13:6: PTH123 `open()` should be replaced by `Path.open()`
   |
11 |     data_json[name] = list(val)
12 | 
13 | with open("radon.json", "w") as file:
   |      ^^^^ PTH123
14 |     json.dump(data_json, file)
   |

notebooks/pytensor_logp.ipynb:cell 37:2:89: E501 Line too long (91 > 88)
  |
1 | %%time
2 | out = !./radon_model sample num_chains=10 save_warmup=1 data file=radon.json num_threads=10
  |                                                                                         ^^^ E501
  |


Fixed 10 errors:
- notebooks/pytensor_logp.ipynb:
    3 × W293 (blank-line-with-whitespace)
    2 × I001 (unsorted-imports)
    2 × E703 (useless-semicolon)
    2 × F401 (unused-import)
    1 × UP015 (redundant-open-modes)

Found 18 errors (10 fixed, 8 remaining).
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).

ruff-format..............................................................Failed
- hook id: ruff-format

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 308bfaa to 84ae2ea Compare September 16, 2024 17:28
Copy link
Member

@twiecki twiecki left a comment

Choose a reason for hiding this comment

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

notebooks/pytensor_logp.ipynb:cell 9:2:89: E501 Line too long (89 > 88)
  |
1 | %%time
2 | # The compilation time is pretty bad right now, I think this can be improved a lot though
  |                                                                                         ^ E501
3 | compiled_model = nutpie.compile_pymc_model(pymc_model)
  |

notebooks/pytensor_logp.ipynb:cell 19:2:6: PTH123 `open()` should be replaced by `Path.open()`
  |
1 | %%time
2 | with open("radon_model.stan") as file:
  |      ^^^^ PTH123
3 |     model = stan.build(file.read(), data=data_stan)
  |

notebooks/pytensor_logp.ipynb:cell 25:1:89: E501 Line too long (168 > 88)
  |
1 | plt.plot((trace_pymc.warmup_sample_stats.n_steps).isel(draw=slice(0, 1000)).cumsum("draw").T, np.log(trace_pymc.warmup_sample_stats.energy.isel(draw=slice(0, 1000)).T))
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
2 | plt.xlim(0, 10000)
3 | plt.ylabel("log-energy")
  |

notebooks/pytensor_logp.ipynb:cell 27:1:89: E501 Line too long (174 > 88)
  |
1 | plt.plot((trace_cmdstan.warmup_sample_stats.n_steps).isel(draw=slice(0, 1000)).cumsum("draw").T, np.log(trace_cmdstan.warmup_sample_stats.energy.isel(draw=slice(0, 1000)).T))
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
2 | plt.xlim(0, 10000)
3 | plt.ylabel("log-energy")
  |

notebooks/pytensor_logp.ipynb:cell 35:1:89: E501 Line too long (113 > 88)
  |
1 | type({name: int(val) if isinstance(val, int) else list(val) for name, val in data_stan.items()}["county_idx"][0])
  |                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ E501
  |

notebooks/pytensor_logp.ipynb:cell 36:8:27: C400 Unnecessary generator (rewrite as a `list` comprehension)
  |
7 |     if val.dtype == np.int64:
8 |         data_json[name] = list(int(x) for x in val)
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ C400
9 |         continue
  |
  = help: Rewrite as a `list` comprehension

notebooks/pytensor_logp.ipynb:cell 36:13:6: PTH123 `open()` should be replaced by `Path.open()`
   |
11 |     data_json[name] = list(val)
12 | 
13 | with open("radon.json", "w") as file:
   |      ^^^^ PTH123
14 |     json.dump(data_json, file)
   |

notebooks/pytensor_logp.ipynb:cell 37:2:89: E501 Line too long (91 > 88)
  |
1 | %%time
2 | out = !./radon_model sample num_chains=10 save_warmup=1 data file=radon.json num_threads=10
  |                                                                                         ^^^ E501
  |


Fixed 10 errors:
- notebooks/pytensor_logp.ipynb:
    3 × W293 (blank-line-with-whitespace)
    2 × I001 (unsorted-imports)
    2 × E703 (useless-semicolon)
    2 × F401 (unused-import)
    1 × UP015 (redundant-open-modes)

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 537f395 to 0cd56a1 Compare October 7, 2024 17:58
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 01d18cd to 5065859 Compare November 4, 2024 17:37
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.7.3](astral-sh/ruff-pre-commit@v0.5.6...v0.7.3)
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.

1 participant