Skip to content

Remove unused config options #806

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

Merged
merged 3 commits into from
Jul 9, 2024
Merged

Remove unused config options #806

merged 3 commits into from
Jul 9, 2024

Conversation

Armavica
Copy link
Member

@Armavica Armavica commented Jun 6, 2024

Description

  • Remove unused config options
  • Add type hints
  • Fix broken check_duplicate_key.py
  • Replace os.path with pathlib
    • Most of the remaining uses are in cmodule.py which I didn't do because it's a lot of work and I am understanding that it is going to go soon.

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@Armavica Armavica force-pushed the pathlib branch 3 times, most recently from 244d74e to d92cef9 Compare June 6, 2024 01:49
@Armavica Armavica changed the title Use pathlib rather than os.path Use pathlib rather than os.path and start typing ConfigParser Jun 6, 2024
@Armavica Armavica force-pushed the pathlib branch 2 times, most recently from d94df18 to c0cf269 Compare June 7, 2024 12:14
@Armavica Armavica force-pushed the pathlib branch 3 times, most recently from 36c93d4 to da6383c Compare June 18, 2024 18:26
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 68.58238% with 82 lines in your changes missing coverage. Please review.

Project coverage is 81.34%. Comparing base (10f285a) to head (8830004).
Report is 104 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/compile/compiledir.py 0.00% 16 Missing ⚠️
pytensor/configdefaults.py 44.82% 13 Missing and 3 partials ⚠️
pytensor/d3viz/d3viz.py 25.00% 9 Missing ⚠️
pytensor/link/c/lazylinker_c.py 55.00% 4 Missing and 5 partials ⚠️
pytensor/misc/check_duplicate_key.py 0.00% 9 Missing ⚠️
pytensor/printing.py 11.11% 8 Missing ⚠️
pytensor/link/c/cutils.py 53.84% 3 Missing and 3 partials ⚠️
pytensor/tensor/blas_headers.py 75.00% 3 Missing ⚠️
pytensor/compile/profiling.py 50.00% 1 Missing ⚠️
pytensor/configparser.py 98.98% 1 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #806      +/-   ##
==========================================
+ Coverage   81.23%   81.34%   +0.10%     
==========================================
  Files         170      170              
  Lines       46826    46833       +7     
  Branches    11465    11432      -33     
==========================================
+ Hits        38041    38097      +56     
+ Misses       6594     6549      -45     
+ Partials     2191     2187       -4     
Files with missing lines Coverage Δ
pytensor/compile/compilelock.py 97.14% <100.00%> (+0.08%) ⬆️
pytensor/link/c/cmodule.py 56.88% <100.00%> (ø)
pytensor/scalar/math.py 87.08% <100.00%> (-0.18%) ⬇️
pytensor/compile/profiling.py 76.08% <50.00%> (+0.03%) ⬆️
pytensor/configparser.py 89.84% <98.98%> (+3.48%) ⬆️
pytensor/d3viz/formatting.py 12.88% <50.00%> (ø)
pytensor/link/c/op.py 62.17% <93.33%> (-0.09%) ⬇️
pytensor/misc/elemwise_openmp_speedup.py 25.58% <50.00%> (+1.77%) ⬆️
pytensor/tensor/io.py 77.41% <66.66%> (+0.75%) ⬆️
pytensor/tensor/blas_headers.py 45.55% <75.00%> (-2.84%) ⬇️
... and 7 more

@Armavica Armavica marked this pull request as ready for review June 18, 2024 19:14
@Armavica Armavica requested a review from ricardoV94 June 18, 2024 19:14
@Armavica Armavica force-pushed the pathlib branch 2 times, most recently from db1f5d2 to b607e55 Compare June 20, 2024 21:49
Copy link
Member

@lucianopaz lucianopaz left a comment

Choose a reason for hiding this comment

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

Looks like an awful lot of long, detailed and tedious work. Great job @Armavica! I left a few comments but once those are done, I think this should be good to go.

path = os.path.realpath(path)
if os.access(path, os.F_OK): # Do it exist?
path = path.resolve()
if path.exists():
if not os.access(path, os.R_OK | os.W_OK | os.X_OK):
Copy link
Member

Choose a reason for hiding this comment

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

This could be changed as well to use path.stat().st_mode, to avoid using os.access, but it might not be worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes indeed, but not sure it's worth it indeed. I think it would make this code more verbose.

@Armavica Armavica force-pushed the pathlib branch 2 times, most recently from b189749 to 90ecf06 Compare June 21, 2024 15:13
@Armavica Armavica requested a review from lucianopaz July 1, 2024 11:16
@Armavica Armavica changed the title Use pathlib rather than os.path and start typing ConfigParser Typing ConfigParser, removing unused config options and using pathlib instead of os.path Jul 6, 2024
@Armavica Armavica changed the title Typing ConfigParser, removing unused config options and using pathlib instead of os.path Remove unused config options, add type hints and replace os.path with pathlib Jul 6, 2024
@Armavica
Copy link
Member Author

Armavica commented Jul 6, 2024

@ricardoV94 I am not sure how to handle this PR regarding labels: Should the removal of unused config options be considered major?

@ricardoV94
Copy link
Member

@ricardoV94 I am not sure how to handle this PR regarding labels: Should the removal of unused config options be considered major?

Nah, because I expect exactly 0 people were trying to set it

@ricardoV94
Copy link
Member

Do you want to squash or rebase and merge?

@Armavica
Copy link
Member Author

Armavica commented Jul 6, 2024

Do you want to squash or rebase and merge?

I would rather not squash, having all the commits makes it easier to bisect and debug if needed. But if you think this is too many commits I can rebase and make less of them.

@ricardoV94
Copy link
Member

Yeah maybe the pathlib ones can be merged together

@Armavica Armavica added the bug Something isn't working label Jul 7, 2024
@Armavica Armavica force-pushed the pathlib branch 4 times, most recently from e3faa72 to d2106bf Compare July 7, 2024 20:04
@Armavica Armavica changed the title Remove unused config options, add type hints and replace os.path with pathlib Remove unused config options Jul 9, 2024
@Armavica Armavica merged commit 2effaf1 into main Jul 9, 2024
58 of 59 checks passed
@Armavica Armavica deleted the pathlib branch July 9, 2024 15:01
@maresb
Copy link
Contributor

maresb commented Jul 9, 2024

@Armavica Armavica mentioned this pull request Jul 9, 2024
11 tasks
@Armavica
Copy link
Member Author

Armavica commented Jul 9, 2024

Ah, a problem that could have been caught with more types!

@ricardoV94
Copy link
Member

Ah, a problem that could have been caught with more types!

And tests :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants