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

numbers edited in bottom right panel are saved as strings in JSON file #112

Open
dave-doty opened this issue Oct 14, 2017 · 5 comments
Open
Assignees

Comments

@dave-doty
Copy link

dave-doty commented Oct 14, 2017

If you edit by typing a numerical value associated to a helix in the bottom right panel, for instance, minor groove angle or length, it is saved as a string in the JSON file instead of a number, which crashes the next time the file is loaded.

This does not appear to be a problem if the value is edited by clicking the up-down arrows to adjust the value, only if the value is typed with the keyboard.

nickfong added a commit to nickfong/cadnano2.5 that referenced this issue Oct 20, 2017
When values in the PropertyEditor were changed by typing in new values,
new values were saved as strings, which caused a crash when opening the
saved file.

This commit casts values of keys that should be floats to floats.
Looked into UI-side validation (since right now the editor allows
non-floats to be entered as a value) without much success; it seems that
a change in PropertyEditorWidget.py (and associated classes) would need
to be made.

Fixes cadnano#112
@dave-doty
Copy link
Author

This bug appears to have returned in the build from 5/29/2018. When I edit "minor groove" to be 150.00 instead of 180.00, it saves "150.00" as a string and crashes.

Side request: could you set the default minor groove to be 150 instead of 180?

@sdouglas sdouglas reopened this Jun 14, 2018
@sdouglas
Copy link
Contributor

Thanks @dave-doty for bringing this to our attention. It's probably a regression from the recent refactoring.

Regarding the default minor groove: Now that we're transitioning to proximity-based crossovers derived from 3D coordinates, we've tried to select defaults that maintain backwards compatibility with previous versions of cadnano. I've hesitated to switch to a 150° default since it would make it very confusing/difficult to load and edit legacy designs. But we'll try to work out a solution, perhaps involving saving this into local user prefs.

@nickfong
Copy link
Contributor

Hi @dave-doty,

Like @sdouglas said, thanks for bringing this up with us. I'm trying to reproduce this and don't seem to be able to. Here's what I'm doing:

  1. Open cadnano
  2. Add a VH
  3. Change minor_groove_angle for said VH to an arbitrary value (I chose 165.0 WLOG)
  4. Save the design and close cadnano
  5. Open the design in cadnano

Cadnano seems to open without issue for me, and looking at the JSON file I see

"minor_groove_angle":[165.0]

for the VH that I added.

To help us more easily track down this issue, could you let me know what steps I should follow to reproduce this? I'm running the most recent version of master (ce6ff01)

Thanks!

@nickfong nickfong self-assigned this Jun 14, 2018
@dave-doty
Copy link
Author

Those are the exact steps I followed, but it saves "minor_groove_angle" as "150.00".

I have commit ce6ff01 (pulled this morning).

If it helps, I'm running Anaconda Python 3.6 on Windows 10. I ran "pip install cadnano" from within an Anaconda prompt for Python 3.6 (it has no pip3, just pip, but it's supposedly for the Python 3.6 installation), and then open cadnano by running "cadnano" from the Anaconda prompt.

@nickfong
Copy link
Contributor

Hi @dave-doty,

Thanks for the quick response and for the extra context. Right now the most recent version of cadnano is not on PyPI, so running

pip install cadnano

will in fact install an older version of cadnano, which I believe explains why you're still seeing this bug.

Could you try running

pip install git+git://github.com/cadnano/cadnano2.5

instead to install cadnano from the most recent commit on GitHub and let us know if you're still seeing this issue after doing so? I think this ought to fix the issue you're seeing.

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

3 participants