-
Notifications
You must be signed in to change notification settings - Fork 865
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
Separate test files by modules and collect test files csv/cif
into folders
#3746
Separate test files by modules and collect test files csv/cif
into folders
#3746
Conversation
Note Reviews PausedUse the following commands to manage reviews:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai ignore |
@janosh Can you please review this? Thank you! |
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.
how about instead of subfolders based on filetype, we split test files by the corresponding pymatgen module?
so a lot of the tests/files/json
would go in tests/files/entries
instead if they contain serialized phase diagram or Pourbaix entries.
CIF files and some JSON files would go in tests/files/structures
.
other folders could be tests/files/electronic_structure
(or just tests/files/electronic
) for band structures and DOS, tests/files/phonons
for phonon BS/DOS, tests/files/lobster
(or perhaps tests/files/io/lobster
), etc.
It would be good to make the test file folders follow the same hierarchy as the code, but I'm afraid there would be huge overlap (and confusion) at least at this stage? (Currently we don't have a one-to-one mapping between test and test files) Multiple module might require access to the same format of file (or even the same file). For example On the other hand, separating files by format seems much easier to access for developers? And would encourage test file re-use (If we group them by modules, people would tend to have a set of test files for each module, and test files from other module may not be re-used). Though people might need to access multiple test file folders if multiple formats are involved within the test. |
hmmm... not sure. how does it become easier? the file extension already makes searching by file type easy. i just type putting it in a JSON folder doesn't confer additional meaning on what the file was meant to be used for. |
I think my intention for cleaning up test files is not to add more information, but to clean up the "root directory" of test file folder 😄 . Currently we have quite a lot
Yes that what I'm concerned about, others would need to "learn" about this agreement then. People would not need to read a |
I would say it's great to make test files follow the same hierarchy as the test in the long term. But that would take more effort and is not what this PR is intended for (just want to avoid having everything lie flat under the root of test file dir). Though I would be happy to help push towards this in the long term :) |
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.
i think the cif/
folder could make sense but i'm less sure about the JSON folder since it's quite a lot more generic, containing files of very different purpose. how about we leave the cif/
folder as you currently have it but split the json/
based on what pymatgen
module the test file belongs to? that way we minimize git diff
from repeatedly moving any files around in subsequent PRs
That's a great idea! Also sounds like a good start towards organizing test files by modules. I would get my hands on this next week. |
csv/cif
into folders and separate json
by modules
csv/cif
into folders and separate test files by modulecsv/cif
into folders
@janosh Please review this as well. I wasn't thinking that we could just do everything in one PR, but luckily here we are :) All test files sorted by module. A side note being: the test files for |
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.
wow, huge PR 👍
Github crashes when i scroll down the list of changes. but tests are passing so this looks safe to merge 😄
Thanks for reviewing! Yes should be safe. No functional changes just relocating test files. Several test files removed with caution though (did global search before removing any), but still could be used implicitly by those disabled tests, so I tagged them in the summary section in case we need to recover any. Do we need to run garbage collection or something? Current clone size seems over 800 MB? |
it used to be ~1GB so 800MB is already an improvement. don't think there's such a thing as garbage collection for git clone https://github.com/materialsproject/pymatgen --depth 1 |
Great to know!
There actually is https://git-scm.com/docs/git-gc. Not sure if it would be run automatically or not.
Thanks for the tip. Just saying though, I don't clone very often so it's not a problem :) |
Summary
csv/cif
into their own foldersjson
files by modulesTasks
json
files by modulesmolecules
are specific toio.qchem
, but there is terribly strong interdependence need to be clarifiedImportant: removed unused test files
molecules
d32b7d9Side note
re
pattern used for renamingjson
file path in VS code: source(f"\{TEST_FILES_DIR\})(/[^/]+\.json(\.gz)?")
, target$1/json$2
, reference herere
pattern forcif
: just replace abovejson
withcif