-
Notifications
You must be signed in to change notification settings - Fork 468
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
Fix tests #1248
Conversation
else: | ||
probs, labels = ([], ()) | ||
|
||
return labels, np.asarray(probs) |
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.
We got some error in the test, and it is relative to numpy and this line, so I created this part of the code just copy pasting from the library
https://github.com/facebookresearch/fastText/blob/1142dc4c4ecbc19cc16eee5cdd28472e689267e6/python/fasttext_module/fasttext/FastText.py#L239
but instead
return labels, np.array(probs, copy=False)
I written return labels, np.asarray(probs)
setup.cfg
Outdated
dateparser/data/date_translation_data/* | ||
dateparser/data/__init__.py | ||
dateparser/languages/__init__.py | ||
docs/conf.py |
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.
In the pipeline, I got some errors relative to flake, after changing no errors anymore
@@ -119,7 +119,7 @@ def test_dates_which_match_locales_are_parsed( | |||
languages=["en"], | |||
region="", | |||
date_formats=["%a", "%a", "%a", "%a"], | |||
expected_date=datetime(1969, 1, 31, 14, 4), | |||
expected_date=datetime(1969, 1, 31, 13, 4), |
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 just changed the digit to resolve the error in this test
@@ -642,7 +642,14 @@ def test_search_and_parse(self, shortname, string, expected, settings=None): | |||
( | |||
"June 23th 5 pm EST", | |||
datetime.datetime( | |||
2023, 6, 23, 17, 0, tzinfo=pytz.timezone("EST") | |||
2023, |
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’ve refactored the CI to run extras separately and test minimum versions of dependencies, and replaced flake8 with ruff to simplify things. I have also removed the proposed fasttext wrapper to instead limit numpy to supported versions when installing the corresponding extra. I don’t think it falls onto us to monkey-patch fasttext. If no one forks the project, we can eventually stop supporting language detection based on it. |
* Fix tests * Fix the TestLocalTZOffset test * Setup tests for minimum deps * Run pre-commit --------- Co-authored-by: Adrián Chaves <adrian@chaves.io>
* Release 1.2.1 * Update HISTORY.rst Co-authored-by: Andrey Rakhmatullin <wrar@debian.org> * Fix tests (#1248) * Fix tests * Fix the TestLocalTZOffset test * Setup tests for minimum deps * Run pre-commit --------- Co-authored-by: Adrián Chaves <adrian@chaves.io> * Add #1248 to History rst * .bumpversion.cfg → pyproject.toml, and have it set the release date * Undo version change to be made by bump-my-version * Update HISTORY.rst Co-authored-by: Adrián Chaves <adrian@chaves.io> * Use CODECOV_TOKEN. --------- Co-authored-by: Andrey Rakhmatullin <wrar@debian.org> Co-authored-by: Adrián Chaves <adrian@chaves.io> Co-authored-by: Andrey Rakhmatullin <wrar@wrar.name>
No description provided.