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

Many of my .pbn files have statistics. #51

Open
ADavidBailey opened this issue Jun 10, 2024 · 6 comments
Open

Many of my .pbn files have statistics. #51

ADavidBailey opened this issue Jun 10, 2024 · 6 comments

Comments

@ADavidBailey
Copy link

I want to use your code to read .pbn files and create .lin files. Dealer V1 and V2 accepts the files and ignores the statistics. Your pbn.load(i_file) fails.

Here's an example:

Minimum : 33.6
Avg : 33.4
Max : 33
5S and 6+D : 22.6
5S and 6+C : 26.2
5H and 6+D : 24.6
5H and 6+C : 26.6
Frequency HCP South :
14 39
15 166
16 173
17 122
18 0
Frequency ntPoints :
14 0
15 168
16 167
17 165
18 0
Generated 2922012 hands
Produced 500 hands
Initial random seed 1717799357
Time needed 8.000 sec

@ADavidBailey
Copy link
Author

I added lines 340 and 341 following the else. That solves my problem.
else:
# Skip lines without a tag -- Added by David Bailey
return False
raise PBNDecodeError("Expected a tag", curline, self.lineno)

@ADavidBailey
Copy link
Author

ADavidBailey commented Jun 11, 2024

BBO will not open/read these .lin files. I know the .lin files that I create are much, much larger that BBO would expect. So I created one with only 24 deals. BBO will not open/read it either. Here are the first four lines...

pn|-,-,-,-|st||md|3S35AH45AD238TQACJ,S9TQH689D456KC34K,S47JKHTQKD7JC278Q,|rh||ah|Board 1|sv|o|pg||
pn|-,-,-,-|st||md|4S689H47D2356C5JQK,S7TJKAH35689ADKCT,S245QHJKD489C4689,|rh||ah|Board 2|sv|n|pg||
pn|-,-,-,-|st||md|1S9H3789D38KAC79JA,S45JH4JAD567TC56T,S267TAH6TQKDQC38K,|rh||ah|Board 3|sv|e|pg||
pn|-,-,-,-|st||md|2S3TJH45JQD26C249A,S45KAHAD378TC68TK,S6789H79TD45JC7JQ,|rh||ah|Board 4|sv|b|pg||

UPDATE: If I delete the pn|-,-,-,-|st|| at the beginning of each line, BBO will import the file.

@ADavidBailey
Copy link
Author

ADavidBailey commented Jun 13, 2024

I wrote a simple program to comment any 'statistics' in pbn files. These lines are still in the pbn files with an '# ' as the first two characters of the lines.

I printed them to stats.txt. Have a look.

https://github.com/ADavidBailey/Practice-Bidding-Scenarios/blob/main/stats.txt

@ADavidBailey
Copy link
Author

ADavidBailey commented Jun 15, 2024

pn|-,-,-,-|st||md|1S9H3789D38KAC79JA,S45JH4JAD567TC56T,S267TAH6TQKDQC38K,|rh||ah|Board 3|sv|e|pg|| pn|-,-,-,-|st||md|2S3TJH45JQD26C249A,S45KAHAD378TC68TK,S6789H79TD45JC7JQ,|rh||ah|Board 4|sv|b|pg||

UPDATE: If I delete the pn|-,-,-,-|st|| at the beginning of each line, BBO will import the file.

BBO relies on the qx|o1| to display the imported board number correctly. I wrote a program to insert the board number after the '0'. Now, they're like this for boards 9 and 10:

qx|o9|md|3S2TKH37TQD4KAC45J,S589AH45JKD25TQCQ,S67JQH9AD379C678T,|rh||ah|Board 9|sv|e|pg||
qx|o10|md|4S369QH239TD5JAC2Q,S47TJKH456JD9C9KA,SAH78QKD236QC578J,|rh||ah|Board 10|sv|b|pg||

They seem to work everywhere.

@dominicprice
Copy link
Owner

thanks for persevering with this, i will try and collect all the lin fixes and update the parser!

@ADavidBailey
Copy link
Author

Per advise of Thorvald, I changed the comment line 1st character from # to %

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

No branches or pull requests

2 participants