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

feat(parameters): add option to 3-1 cross-links #249

Merged
merged 17 commits into from
Feb 14, 2024
Merged

Conversation

TheLostLambda
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2904aa1) 69.37% compared to head (3a5ae41) 69.29%.

Files Patch % Lines
lib/pgfinder/pgio.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
- Coverage   69.37%   69.29%   -0.08%     
==========================================
  Files          11       11              
  Lines         493      495       +2     
==========================================
+ Hits          342      343       +1     
- Misses        151      152       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheLostLambda
Copy link
Member Author

This is ready for review @ns-rse / @bobturneruk !

In the future I wonder if we do go back to committing the pgfinder wheel file in this repo... If I want to set up a v1.1.0 in a PR, I need to actually release that version to PyPi before any of the tests will pass here...

Perhaps the solution in the future is to hard-code in using the pre-release version in the PR? Then immediately commit to main and release the non-rc version after merging? Bit of a messy process at the moment!

Copy link
Collaborator

@ns-rse ns-rse left a comment

Choose a reason for hiding this comment

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

Minor suggestion to have a test that covers the exception raised and some thoughts on how to handle release notes, I'll see if I can work out a neater solution, but I'd be inclined to stick with making releases from GitHub myself as its (slightly) less work.

@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] - 2023-10-15
Copy link
Collaborator

Choose a reason for hiding this comment

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

To avoid the circularity of having to release I would typically not detailed the changes in the CHANGELOG.md until after a release has been made.

We have automatic releasing to PyPI set up through a GitHub Action (.github/workflows/release-to-pypi.yaml) such that when a release is made, which obliges a tag to be added to the current HEAD commit, it triggers building and publishing.

There is also .github/workflows/release-to-orda.yaml which is triggered releases and tagging commits which uploads the artefacts to Sheffields ORDA figshare site (although it often times out and needs re-running).

I'll see if there is a way of automatically building the CHANGELOG.md from Release Notes in some manner (maybe there is an action that can be included).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think adding changes to the changelog under the "Unreleased" section seems like a nice thing to do in a PR, but I'll agree that pushing a release like this in a PR might be a bit much!

@@ -171,6 +171,14 @@ def theo_masses_reader(file: Union[str, Path]) -> pd.DataFrame:
"columns. Have you checked the format of your database against one of the built-in databases?"
)
) from e
# Check that all structures are followed by "|n" where n is one or more digits
if not theo_masses_df["Inferred structure"].str.contains(r"\|\d+$").all():
raise UserError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Codecov is saying this eventuality isn't tested.

Should be relatively straight-forward to construct a test for this (and other checks if they're not already covered) by having a simple CSV without the |[1|2] construct and using the...

@pytest.mark.parameterize(
    "file,error", 
    [
     
   ("tests/resources/file1.csv", UserError),
     
   ("tests/resources/file2.csv", ValueError),
]
)
def test_exceptions(file: str, error) -> None:
    with pytest.raises(error)
        assert theo_masses_reader(file)

(or similar, bit of a rough hack/guess at the code).

Copy link
Member Author

Choose a reason for hiding this comment

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

It's true that none of the exceptions are currently tested, I think, so I'll try to add in some proper tests in a bit!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @TheLostLambda 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry for the long silence @ns-rse ! How would you feel about writing up a Github issue for writing these tests (there are a lot of them and I might not have the time for a little while) and merging this PR so that the e2e tests are fixed for things like dependency bumping?

Copy link
Member Author

Choose a reason for hiding this comment

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

(To clarify, I would write up the Github issue!)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm of the opinion, based on my own failings in the past, that tests should be written when features are implemented. They purpose is after all to ensure that the code we write functions as expected and we ensure that by writing tests. In the past I've found that I let things slip or forget to update tests.

I've created the issue to remind us of this need in #251 mainly because I've started using the excellent browser extension Refined Github that simplifies the GitHub interface and adds useful features, one of which is an additional item to the ... of each message in PRs to Reference in new issue which takes the text of the post and creates a new issue out of it, including a link back to the original discussion at the bottom. Brilliant extension with a huge amount of tweaks which I'm only just starting to familiarise myself with.

ns-rse added a commit that referenced this pull request Jan 10, 2024
The failed library tests are present in existing PR #249 the playwright tests already fail in #252. These should be addressed there after merging these changes from `main`.
@ns-rse ns-rse mentioned this pull request Feb 14, 2024
Copy link
Collaborator

@ns-rse ns-rse left a comment

Choose a reason for hiding this comment

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

Tests now pass, happy to approve #251 captures testing exceptions.

@ns-rse ns-rse merged commit dc4240d into master Feb 14, 2024
13 of 15 checks passed
@ns-rse ns-rse deleted the mainline-3-1-crosslinks branch February 14, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants