Skip to content
Snippets Groups Projects
Commit e1c2cd62 authored by Jason R Laura's avatar Jason R Laura
Browse files

Setup travis, coveralls, and README

parent e95ca037
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ source = autocnet ...@@ -3,6 +3,7 @@ source = autocnet
[report] [report]
omit = omit =
plio/ControlNetFileV0002_pb2.py plio/ControlNetFileV0002_pb2.py
*/sqlalchemy_json/*
*/tests/* */tests/*
exclude_lines = exclude_lines =
pragma: no cover pragma: no cover
......
===============================
AutoCNet
===============================
.. image:: https://badges.gitter.im/USGS-Astrogeology/autocnet.svg
:alt: Join the chat at https://gitter.im/USGS-Astrogeology/autocnet
:target: https://gitter.im/USGS-Astrogeology/autocnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://img.shields.io/pypi/v/autocnet.svg
:target: https://pypi.python.org/pypi/plio
.. image:: https://travis-ci.org/USGS-Astrogeology/plio.svg?branch=master
:target: https://travis-ci.org/USGS-Astrogeology/plio
.. image:: https://coveralls.io/repos/USGS-Astrogeology/plio/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/USGS-Astrogeology/plio?branch=master
.. image:: https://readthedocs.org/projects/plio/badge/?version=latest
:target: http://plio.readthedocs.org/en/latest/
:alt: Documentation Status
A planetary file I/O API
...@@ -87,6 +87,7 @@ def to_isis(path, obj, mode='w', version=VERSION, ...@@ -87,6 +87,7 @@ def to_isis(path, obj, mode='w', version=VERSION,
point_sizes, point_sizes,
creation_date, creation_date,
modified_date) modified_date)
print(point_sizes)
# Write the buffer header # Write the buffer header
store.write(buffer_header, HEADERSTARTBYTE) store.write(buffer_header, HEADERSTARTBYTE)
# Then write the points, so we know where to start writing, + 1 to avoid overwrite # Then write the points, so we know where to start writing, + 1 to avoid overwrite
......
import os import os
import sys import sys
from time import strftime, gmtime
import unittest import unittest
import numpy as np
import pandas as pd import pandas as pd
import pvl import pvl
...@@ -22,29 +22,21 @@ class TestWriteIsisControlNetwork(unittest.TestCase): ...@@ -22,29 +22,21 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
serial_times = {295: '1971-07-31T01:24:11.754', serial_times = {295: '1971-07-31T01:24:11.754',
296: '1971-07-31T01:24:36.970'} 296: '1971-07-31T01:24:36.970'}
cls.serials = ['APOLLO15/METRIC/{}'.format(i) for i in serial_times.values()] cls.serials = ['APOLLO15/METRIC/{}'.format(i) for i in serial_times.values()]
net = CandidateGraph({'a': ['b'], 'b': ['a']}) columns = ['point_id', 'point_type', 'serialnumber', 'measure_type', 'x', 'y', 'node_id']
for i, n in net.nodes_iter(data=True):
n._keypoints = pd.DataFrame(np.arange(10).reshape(cls.npts,-1), columns=['x', 'y'])
n._isis_serial = cls.serials[i]
source = np.zeros(cls.npts) data = []
destination = np.ones(cls.npts) for i in range(cls.npts):
pid = np.arange(cls.npts) data.append((i, 2, cls.serials[0], 2, 0, 0, 0))
data.append((i, 2, cls.serials[1], 2, 0, 0, 1))
matches = pd.DataFrame(np.vstack((source, pid, destination, pid)).T, columns=['source_image', dfs = [pd.DataFrame(data, columns=columns)]
'source_idx',
'destination_image',
'destination_idx'])
net.edge[0][1].matches = matches cls.creation_date = strftime("%Y-%m-%d %H:%M:%S", gmtime())
net.generate_cnet(clean_keys=[]) cls.modified_date = strftime("%Y-%m-%d %H:%M:%S", gmtime())
io_controlnetwork.to_isis('test.net', dfs, mode='wb', targetname='Moon')
cls.creation_date = net.creationdate cls.header_message_size = 78
cls.modified_date = net.modifieddate cls.point_start_byte = 65614
io_controlnetwork.to_isis('test.net', net, mode='wb', targetname='Moon')
cls.header_message_size = 98
cls.point_start_byte = 65634
def test_create_buffer_header(self): def test_create_buffer_header(self):
with open('test.net', 'rb') as f: with open('test.net', 'rb') as f:
...@@ -94,7 +86,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase): ...@@ -94,7 +86,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
self.assertEqual(675, points_bytes) self.assertEqual(675, points_bytes)
points_start_byte = find_in_dict(pvl_header, 'PointsStartByte') points_start_byte = find_in_dict(pvl_header, 'PointsStartByte')
self.assertEqual(65634, points_start_byte) self.assertEqual(self.point_start_byte, points_start_byte)
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment