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

Remove needless functions from an io.ascii test helper file #15782 issue sloved #15787

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Rohit-Pujari
Copy link

@Rohit-Pujari Rohit-Pujari commented Dec 23, 2023

assert_equal()
assert_almost_equal()
assert_true()

Description

Fixes #15782

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

 assert_equal()
 assert_almost_equal()
 assert_true()
Copy link

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but we cannot check for it on Actions; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to Astropy 👋 and congratulations on your first pull request! 🎉

A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.

If you feel that this pull request has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail feedback@astropy.org.

@pllim
Copy link
Member

pllim commented Dec 23, 2023

Thanks! However, failures are real. Please do try run the test suite locally and see.

https://docs.astropy.org/en/latest/development/testguide.html

https://docs.astropy.org/en/latest/development/workflow/development_workflow.html#pre-commit

@Rohit-Pujari
Copy link
Author

image
unable to install repo dependencies

@Rohit-Pujari
Copy link
Author

i have replaced the functions as mentioned but unable to run the tests

@Rohit-Pujari
Copy link
Author

image
unable to update/upgrade astropy to the required version , there is a issue with the asdf-astropy,
i have tried to install the latest astropy version but yet the error persist

@pllim
Copy link
Member

pllim commented Dec 24, 2023

Two things:

  1. You need MSVC to compile C-extensions if you are going to build astropy from source. MSVC installation is separate from pip. You need to follow your Windows side instructions. https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
  2. You need to fetch tags from upstream to get setuptools_scm to render the version properly. git fetch upstream --tags

@dhomeier
Copy link
Contributor

Thank you for working on this. 2 general comments:

  1. assert is a statement, not a function, and thus should be generally written without parentheses (a bit surprised Ruff or black don't catch this).
  2. The failed imports show that there are still a number of uses of the removed functions left. You should check for any remaining occurrences e.g. with
    git grep assert_.*equal astropy/io/ascii

@dhomeier
Copy link
Contributor

Your last commit brings in a number of changes inside your .vs subdirectory; this does not belong to the repo and you should neither add nor remove anything inside. @pllim is this a standard path for visual studio – should perhaps be added to .gitignore?

I suggest you git reset to your first commit and continue from there, so none of those files will show up.

@Rohit-Pujari
Copy link
Author

@dhomeier i have double checked those functions uses and there are none remaining, the numpy.testing.assert_** is similar to those but i have not touched those

@dhomeier
Copy link
Contributor

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

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

Thanks; could you try to at least install the pre-commit setup locally as documented in the second link Pey Lian posted above? I think this should function without needing a working compiler installation, and you can then check those warnings and diagnostics like https://results.pre-commit.ci/run/github/2081289/1703509121.Z6WkqI4KQVm9d2te2s3qhg before committing.

@@ -8,7 +8,6 @@

from .common import (
assert_almost_equal,
Copy link
Contributor

Choose a reason for hiding this comment

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

E.g. this – you may have removed all actual uses, but some imports are left (again, I really wonder why flycheck did not catch the unused import).

Correcting myself; pre-commit did fail as well – are you able to run this locally?

Copy link
Author

Choose a reason for hiding this comment

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

image
it gives error

@dhomeier
Copy link
Contributor

Someone familiar with Windows configuration will need to look into your pre-commit setup problems.
In the meantime you might try to at least install black and ruff (through conda or pip) to run the checks manually as described in https://docs.astropy.org/en/latest/development/codeguide.html#coding-style-conventions , i.e. either with tox -e codestyle, or if that does not work, black astropy/io/ascii and ruff --fix --show-fixes astropy/io/ascii.

@Rohit-Pujari
Copy link
Author

image
image
image

@dhomeier
Copy link
Contributor

The tox errors look the same as for pre-commit, or perhaps tox depends on pre-commit working.
But with the fixes from Ruff and black in, should be safe to commit and push the next attempt.

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

The introduction of irrelevant IDE files is undesirable.

@pllim
Copy link
Member

pllim commented Jan 3, 2024

If Windows is giving you too much trouble, please consider using a Linux distro via WSL2.

@dhomeier
Copy link
Contributor

dhomeier commented Jan 3, 2024

The introduction of irrelevant IDE files is undesirable.

I have already requested clearing those from the branch. This will need squashing anyway – do you know if that will take care of removing those from the history for good?

@pllim
Copy link
Member

pllim commented Jan 4, 2024

Re: #15787 (comment)

Indeed squashing would clear them out but they have to disappear from the final diff first for that to work. Unless you remember to use the Squash and Merge button, it is safer to squash it locally and force push so we can have a clean PR history before merge.

If the files accidentally get in main, it is going to be a pain because I have to break rules and squash the main branch.

@dhomeier
Copy link
Contributor

dhomeier commented Jan 4, 2024

Yes, agreed this should be clean in the local branch first; that's why I had also suggested as a possible solution to do a (soft) reset to 4c62f32 or be9bf92 and then redo the commit without the junk files.

@Rohit-Pujari
Copy link
Author

Sorry my college started that's why I was unable to work at it

Copy link

Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

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

Successfully merging this pull request may close these issues.

Remove needless functions from an io.ascii test helper file
4 participants