-
Notifications
You must be signed in to change notification settings - Fork 19
[pre-commit.ci] pre-commit autoupdate #145
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3aa7526
to
7f3b5ec
Compare
7f3b5ec
to
a7808d4
Compare
f172de2
to
30879da
Compare
twiecki
approved these changes
Sep 3, 2024
twiecki
requested changes
Sep 3, 2024
There was a problem hiding this 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
308bfaa
to
84ae2ea
Compare
twiecki
approved these changes
Sep 17, 2024
twiecki
requested changes
Sep 17, 2024
There was a problem hiding this 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)
84ae2ea
to
3b1b41c
Compare
3b1b41c
to
537f395
Compare
537f395
to
0cd56a1
Compare
0cd56a1
to
e81688b
Compare
01d18cd
to
5065859
Compare
5065859
to
ec63e1c
Compare
c34bc88
to
a5a5e02
Compare
16cf388
to
21fc607
Compare
21fc607
to
ab61e66
Compare
ab61e66
to
cfa36b3
Compare
5e97751
to
1be9281
Compare
1be9281
to
367d7f2
Compare
367d7f2
to
57d6cc3
Compare
57d6cc3
to
b2fb381
Compare
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.9.6](astral-sh/ruff-pre-commit@v0.5.6...v0.9.6)
b2fb381
to
7b8c2c6
Compare
Fixed in #168 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
updates: