Giter VIP home page Giter VIP logo

pydaedalus's Introduction

Daedalus - software to render nearly any 3D geometry as a scaffolded DNA origami nanoparticle.

Your 3D models can be input using the Polygon File Format (.ply).

Build Status Coverage Status MIT licensed

Installation

  1. Clone this repo
  2. (optional) Set up a virtualenv.
  3. pip -r requirements in this project's root.

Usage

At the minimum when calling demo_daedalus.py, you need to tell it what ply file to run. For example, running pyDAEDALUS on the included ply file 05_icosahedron.ply can be done with the command:
python demo_daedalus.py --input_filename=PLY_Files/05_icosahedron.ply Note including the .ply extension is optional. So the following command would be equivalent: python demo_daedalus.py --input_filename=PLY_Files/05_icosahedron

You can also run a batch of ply files at a time by specifying an input foldername rather than a single ply file:
python demo_daedalus.py --input_foldername=PLY_Files

Adding the flag --display_plots asks the program, in addition to saving the plots to your output folder, to print them to screen. For example:
python demo_daedalus.py --input_filename=PLY_Files/37_enneagonal_trapezohedron.ply --display_plots

Additional options include:

  • --results_foldername=yourfoldername where 'yourfoldername' is the name of the folder you want to save this command's results in. Folder will be created if it doesn't already exist.
  • --suppress_console_output (flag) if you want to not have things printed to your console at runtime. (always suppressed when running a batch)
  • --reset_results_folder (flag) if you want to erase all data within your output folder before running the current command.

You can find the complete list of arguments with descriptions with python demo_daedalus.py --help.

All files saved into Results includes both shape name and min_len_nt in the filename to avoid undesired filename collisions.

Tests

Testing uses py.test. Ways to run tests manually include:

  • Simply run make test. This leverages Makefile to run tests with the right syntax.
  • Run all tests by directly calling pytest: py.test
  • Run all tests and drop into a bpython-enabled debugger at failure: py.test --bpdb
  • To run a test class or stand-alone function: py.test tests/test_ply_to_input.py::test_ply_input_for_05_icosahedron
  • To run a single function within a test class: py.test tests/test_ply_to_input.py::TestIntegrationsUsing01Tetrahedron::test_generate_spanning_tree

Coverage

Testing coverage done with pytest-cov package. Manually run coverage report with:

  • py.test --cov=Automated_Design tests/ to run coverage on folder Automated_Design using all tests found in tests folder.
  • py.test --cov-report html --cov-report term --cov=Automated_Design tests/ to run coverage report as above, but with also generating a line-by-line report formatted as html (viewable in your browser by opening the created files)

The only code deliberately excluded from tests are plotting functions (e.g., ply_to_input.plot_edge_length_distributions) and functions that simply write raw internal data to disk (e.g., csv_staples). All such functions are marked to not be included in the coverage report by adding the comment # pragma: no cover on the same line as the function definition.

Makefile

For convenience, Makefile is used to add several command shortcuts to do common testing operations:

  • make to run both linting and tests (linting is only ran if tests pass)
  • make test to run only tests.
  • make lint to run only linting.
  • make coverage to run coverage report. The report is returned as both top level statistics to terminal and a line-by-line report saved into folder htmlcov as html files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.