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

Require detector_db in all cities #851

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

jwaiton
Copy link
Collaborator

@jwaiton jwaiton commented Feb 12, 2024

As discussed in issue #850, the default city decorator provides detector_db = 'new' to each city if none is provided. This causes some issues (particularly with Beersheba) and so has been removed.

In doing so, multiple cities now require detector_db to be within their config files to pass tests, and indexation_test.py has been modified to account for this change in city signature.

Closes #850

@gonzaponte gonzaponte self-requested a review February 12, 2024 15:03
@gonzaponte
Copy link
Collaborator

Looks good. The only test failing is known to fail and has nothing to do with this. I would like to have a test that verifies that all cities indeed require this argument and there is nothing else messing around.

@gonzaponte gonzaponte changed the title Alter detector_db implementation Make detector_db a non-optional city argument Feb 14, 2024
@jwaiton
Copy link
Collaborator Author

jwaiton commented Feb 19, 2024

I've developed the test within db_test.py, I believe it works as intended (tested different cases and got the expected results), but it's my first time developing python tests so I could have made some errors that I'm unaware of.

This test can easily be included in the cities_test.py file, which I'll do after I've finalised the test wrt any feedback you have.

@jwaiton
Copy link
Collaborator Author

jwaiton commented Feb 19, 2024

More tests are now failing on github which didn't fail locally, although I'm not entirely sure why. They all seem to be related to an attribute error:
AttributeError: 'function' object has no attribute 'send'

Rerunning these tests locally do not produce the same errors, it may be something to do with how I defined the relative import paths, but I'm not entirely sure.

Copy link
Collaborator

@gonzaponte gonzaponte left a comment

Choose a reason for hiding this comment

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

I don't quite understand the error either, I will have to look at it more interactively. But this error wasn't there before the last commit, right?

@jwaiton
Copy link
Collaborator Author

jwaiton commented Feb 19, 2024

I don't quite understand the error either, I will have to look at it more interactively. But this error wasn't there before the last commit, right?

You're correct, the error wasn't present before this commit.

@gonzaponte
Copy link
Collaborator

it may be something to do with how I defined the relative import paths, but I'm not entirely sure.

Change
from invisible_cities.core.configure import configure
to
from .. core.configure import configure

@jwaiton
Copy link
Collaborator Author

jwaiton commented Feb 19, 2024

I've added the regexp to the test as well as the required changes and it seems to work as expected locally. Hopefully the same is true on github :)

@gonzaponte
Copy link
Collaborator

Hmm. Tests pass locally for me as well... This is bizarre.

Copy link
Collaborator

@gonzaponte gonzaponte left a comment

Choose a reason for hiding this comment

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

I think this is the last of it. If the checks pass we will rewrite the commit history a bit and merge.

@jwaiton
Copy link
Collaborator Author

jwaiton commented Feb 20, 2024

That should be it, hopefully it passes all the tests :)

@gonzaponte gonzaponte self-requested a review February 21, 2024 14:25
@gonzaponte
Copy link
Collaborator

The history has been cleaned up with peras.

Copy link
Collaborator

@gonzaponte gonzaponte left a comment

Choose a reason for hiding this comment

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

A necessary improvement towards NEXT100: not assuming a detector configuration. Great work.

@gonzaponte gonzaponte changed the title Make detector_db a non-optional city argument Require detector_db in all cities Feb 22, 2024
@carhc carhc merged commit ec611b4 into next-exp:v2-development Feb 22, 2024
1 check passed
@carhc
Copy link
Collaborator

carhc commented Feb 22, 2024

Just merged! Thanks @jwaiton for your first contribution to IC! Looking forward to seeing more of your nice work!

@jwaiton jwaiton deleted the force-detector_db branch March 1, 2024 12:22
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.

3 participants