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

problog sample not behaving as in documentation #101

Open
theresasturn opened this issue Apr 13, 2023 · 4 comments
Open

problog sample not behaving as in documentation #101

theresasturn opened this issue Apr 13, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@theresasturn
Copy link

When I type the following command:

problog sample some_heads.pl -N 3

I get as output:


someHeads.

someHeads.
(True, <generator object sample at 0x7f5f192aca50>)

rather than

====================
% Probability: 0.2

someHeads.
% Probability: 0.2

someHeads.
% Probability: 0.3

as in the documentation. I.e., no probabilities are printed out for me.

@theresasturn
Copy link
Author

Seems to be a general problem with sample a generator object is created, but its results are not output:

@rmanhaeve
Copy link
Contributor

Hi

It seems that the output you get is an issue with the problog-cli tool. It should not be outputted.
The documentation is also incomplete, as you need to set the --with-probabilty flag to get the desired output:

someHeads.
% Probability: 0.3
----------------
someHeads.
% Probability: 0.3
----------------
someHeads.
% Probability: 0.3
(True, <generator object sample at 0x7f714a63ae40>)

I hope this helps in the meantime.
Kind regards,
Robin

@rmanhaeve rmanhaeve added the bug Something isn't working label Apr 17, 2023
@theresasturn
Copy link
Author

theresasturn commented Apr 18, 2023 via email

@sdemjanenko
Copy link

The issue appears to be sys.exit(main()) in the CLI script that pip creates. If I add this to problog-cli.py in this repo, then I can reproduce with python ./problog-cli.py sample test/sample/some_heads.pl -N 6. I am not clear on where the sys.exit(main()) is coming from. It doesn't seem to be in this repo. I see a few references:

conversions/uai2problog.py
321:    sys.exit(main())

conversions/bn2problog.py
216:    sys.exit(main())

conversions/smile2problog.py
105:    sys.exit(main())

conversions/hugin2problog.py
203:    sys.exit(main())

conversions/xmlbif2problog.py
150:    sys.exit(main())

But none of them seem to be that CLI script that gets installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants