Skip to content

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

Closed
Rohit-Pujari wants to merge 4 commits into
astropy:mainfrom
Rohit-Pujari:main
Closed

Rohit-Pujari wants to merge 4 commits into
astropy:mainfrom
Rohit-Pujari:main

Conversation

@Rohit-Pujari

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

Copy link
Copy Markdown

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()
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 [email protected].

@pllim

pllim commented Dec 23, 2023

Copy link
Copy Markdown
Member

@Rohit-Pujari

Copy link
Copy Markdown
Author

image
unable to install repo dependencies

@Rohit-Pujari

Copy link
Copy Markdown
Author

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

@Rohit-Pujari

Copy link
Copy Markdown
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

pllim commented Dec 24, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@dhomeier dhomeier left a comment •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

image
image
image

@dhomeier

Copy link
Copy Markdown
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.

@pllim pllim left a comment

Copy link
Copy Markdown
Member

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

pllim commented Jan 3, 2024

Copy link
Copy Markdown
Member

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

@dhomeier

dhomeier commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

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

pllim commented Jan 4, 2024

Copy link
Copy Markdown
Member

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

dhomeier commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Author

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

@astrofrog astrofrog modified the milestones: v6.1.0, v7.0.0 Apr 4, 2024
@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label May 24, 2024
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the closed-by-bot Closed by stale bot label Jun 24, 2024
@github-actions

Copy link
Copy Markdown
Contributor

I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks!

If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here.

@github-actions github-actions Bot closed this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Close? Tell stale bot that this issue/PR is stale closed-by-bot Closed by stale bot io.ascii no-changelog-entry-needed Refactoring testing

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