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

Update dataset repo to version 1.0 #8

Merged
merged 32 commits into from
Aug 23, 2022
Merged

Update dataset repo to version 1.0 #8

merged 32 commits into from
Aug 23, 2022

Conversation

jteijema
Copy link
Member

This PR will update the template to version 1.0, and test it's functionality.

@jteijema jteijema self-assigned this Jun 17, 2022
@jteijema
Copy link
Member Author

Will take care of #6 #7 and #1.

@jteijema
Copy link
Member Author

image

Installing this template adds the datasets to the DatasetManager.

@jteijema jteijema marked this pull request as ready for review June 17, 2022 12:23
jteijema added 2 commits June 23, 2022 11:46
Turns out, you can't. Datasets should always be inside a dataset group object.
Copy link
Member

@J535D165 J535D165 left a comment

Choose a reason for hiding this comment

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

Thanks, few suggestions, and some styling issues.

README.md Outdated Show resolved Hide resolved
asreviewcontrib/dataset_name/your_dataset.py Outdated Show resolved Hide resolved
asreviewcontrib/dataset_name/your_dataset.py Outdated Show resolved Hide resolved
asreviewcontrib/dataset_name/your_dataset.py Outdated Show resolved Hide resolved
asreviewcontrib/dataset_name/your_dataset.py Outdated Show resolved Hide resolved
asreviewcontrib/dataset_name/your_dataset.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@jteijema
Copy link
Member Author

Updated the dataset file to pep8 style @J535D165

@jteijema
Copy link
Member Author

jteijema commented Aug 23, 2022

@J535D165 ASReview still has a problem handling local files I think:
image

ERROR:root:<urlopen error unknown url type: c>

Moreover, the code for the filepath is currently;

            filepath=str(Path(Path(__file__).parent,
                              'data',
                              'your_dataset.csv')),

I think being able to give a path instead of a str would be optimal.

Giving a path results in:

ERROR:asreview.webapp.start_flask:Exception on /api/datasets [GET]
Traceback (most recent call last):
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\asreview\webapp\api.py", line 291, in api_demo_data_project
    response = jsonify(payload)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\json\__init__.py", line 301, in jsonify
    f"{dumps(data, indent=indent, separators=separators)}\n",
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\json\__init__.py", line 131, in dumps
    return _json.dumps(obj, **kwargs)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 234, in dumps
    return cls(
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\json\__init__.py", line 50, in default
    return super().default(o)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type WindowsPath is not JSON serializable
ERROR:root:Object of type WindowsPath is not JSON serializable

@jteijema jteijema requested a review from J535D165 August 23, 2022 09:36
setup.py Outdated Show resolved Hide resolved
@J535D165 J535D165 merged commit 88afcd6 into asreview:main Aug 23, 2022
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