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

testsuite failure: TypeError: object of type 'bool' has no len() #105

Closed
jonassmedegaard opened this issue Nov 27, 2021 · 2 comments
Closed
Labels

Comments

@jonassmedegaard
Copy link

ontospy 1.9.9.2 fails to build on Debian:

ERROR: test1_load_locally (__main__.TestLoadOntologies)
Check if the ontologies in /RDF folder load ok
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/ontospy/tests/test_load_local.py", line 46, in test1_load_locally
    c.describe()
  File "/<<PKGBUILDDIR>>/ontospy/core/entities.py", line 387, in describe
    self.printStats()
  File "/<<PKGBUILDDIR>>/ontospy/core/entities.py", line 377, in printStats
    printInfo("Instances....: %d" % self.count())
  File "/<<PKGBUILDDIR>>/ontospy/core/entities.py", line 366, in count
    return len(self.instances)
TypeError: object of type 'bool' has no len()

Full build log is at https://buildd.debian.org/status/fetch.php?pkg=ontospy&arch=all&ver=1.9.9.2%7Edfsg-1&stamp=1638035122&raw=0

@lambdamusic
Copy link
Owner

Hi @jonassmedegaard - thanks for the feedback.

I think this is because .instances defaults to False instead of a list.

The method .instances was a quick way to pull out class instances from the class - rather than extracting all of them in advance, which is what is required in order to build documentation pages programmatically.

The recent version 1.9.9.2 provides a more solid way to handle instances i.e. they can be all be extracted and indexed when Ontospy is instantiated (hide_individuals=False) by providing a flag.

I'll reset .instances to return an empty list by default. That should fix it

@lambdamusic lambdamusic added the bug label Dec 8, 2021
@lambdamusic
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants