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

Occupancy read error when there is blank #3

Closed
CryoSky opened this issue Apr 20, 2020 · 2 comments
Closed

Occupancy read error when there is blank #3

CryoSky opened this issue Apr 20, 2020 · 2 comments

Comments

@CryoSky
Copy link
Collaborator

CryoSky commented Apr 20, 2020

occupancy=float(line[54:60]),
tempFactor=float(line[60:66]),

The occupancy and temFactor could report error 'could not convert string to float' when there is blank.
Suggest to change like this:
occupancy=[0.0 if line[54:60].strip()=='' else float(line[54:60])],
tempFactor=[0.0 if line[60:66].strip()=='' else float(line[60:66])],

@CryoSky CryoSky changed the title Occupancy Occupancy read error when there is blank Apr 20, 2020
@cabb99
Copy link
Owner

cabb99 commented Apr 21, 2020

Thank you, I changed it.
I just removed the brackets, since we are expecting a single number.

@cabb99 cabb99 closed this as completed Apr 21, 2020
@CryoSky
Copy link
Collaborator Author

CryoSky commented Apr 21, 2020

There is still some error. When I tested, it shows "IndentationError: unexpected indent".

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