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

fixing unittest errors on windows #222

Merged
merged 190 commits into from
Oct 18, 2021
Merged

Conversation

deng113jie
Copy link
Contributor

main type of errors:

  1. datetime.timestamp gives oserror for time before 1970
    solution: add timezone to datetime
  2. categorical field dict key is type str on windows but bytes on linux
    solution: change dict key to bytes if is string
  3. index must be type int64
    solution: change type to int64
    4)one minor issue in categorical field values

Also added workflow files for macos & windows
Added a example cython file to test the compile workflow

jie and others added 30 commits March 11, 2021 16:17
add get_spans() in Field class, similar to get_spans() in Session class
to add CSVDataset file as the import required in module init
…ction in core.operations.

Provide get_spans methods in fields using data attribute.
Modify the get_spans functions in Session to call field method and operation method.
@@ -23,8 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 numpy numba pandas h5py
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8 numpy numba pandas h5py cython
Copy link
Member

Choose a reason for hiding this comment

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

We should be installing what's in the requirements.txt file so we don't have to change things here if we add more requirements, so just have pip install -r requirements.txt since we know that file is always there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I will update that.

@@ -0,0 +1,8 @@
def fib(n):
Copy link
Member

Choose a reason for hiding this comment

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

Example code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, so that the package can be compile. Should be removed later once we have real functions in.

@@ -12,7 +12,7 @@
import time
from collections import defaultdict
import csv
from datetime import datetime
from datetime import datetime, timezone, timedelta
Copy link
Member

Choose a reason for hiding this comment

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

timezone and timedelta unused?

Copy link
Member

@ericspod ericspod left a comment

Choose a reason for hiding this comment

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

It seems that we're assuming all datetimes here are always UTC, this will vary from the truth by an hour at times when daylight savings is relevant, but so long as that's systematic always across platforms that's fine for our purposes. Just a few things I mentioned

@deng113jie deng113jie merged commit b6864c1 into KCL-BMEIS:master Oct 18, 2021
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.

4 participants