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

Default values for configuration settings #273

Closed
osma opened this issue Apr 25, 2019 · 1 comment
Closed

Default values for configuration settings #273

osma opened this issue Apr 25, 2019 · 1 comment
Assignees
Milestone

Comments

@osma
Copy link
Member

osma commented Apr 25, 2019

Currently some configuration settings, especially limit, must be set, otherwise Annif will raise an exception:

  File "/home/ozone/git/Annif/annif/cli.py", line 165, in run_suggest
    hits = hit_filter(project.suggest(text, backend_params))
  File "/home/ozone/git/Annif/annif/project.py", line 175, in suggest
    hits = self._suggest_with_backend(text, backend_params)
  File "/home/ozone/git/Annif/annif/project.py", line 115, in _suggest_with_backend
    hits = self.backend.suggest(text, project=self, params=beparams)
  File "/home/ozone/git/Annif/annif/backend/backend.py", line 44, in suggest
    return self._suggest(text, project, params=beparams)
  File "/home/ozone/git/Annif/annif/backend/tfidf.py", line 55, in _suggest
    return fullresult.filter(limit=int(self.params['limit']))
  File "/usr/lib/python3.6/configparser.py", line 1233, in __getitem__
    raise KeyError(key)
KeyError: 'limit'

This is unfriendly to the user. There should be sane defaults for all settings. limit should default to 100, project name should default to its id, chunksize should default to 0 (no chunking) etc.

@juhoinkinen
Copy link
Member

This was covered in #324 and made to release 0.43.

@juhoinkinen juhoinkinen modified the milestones: Short term, 0.43 Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants