Commit a5ed8f0e authored by celinemercier's avatar celinemercier

A basic obicount for testing purposes

parent 3b3267db
import sys
import argparse
from obitools3.obidms.obidmscolumn.capidmscolumn import OBIDMS_column
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Computes the sum of a column.')
parser.add_argument('-d', '--dms', dest='dms_name', type=str,
help='Name of the OBIDMS containing the column')
parser.add_argument('-c', '--column', dest='column_name', type=str, default='count',
help="Name of the OBIDMS column (default: 'count')")
parser.add_argument('-v', '--version', dest='version_number', type=int, default=-1,
help='Version number of the column (default: latest version)')
args = parser.parse_args()
c = OBIDMS_column.open(args.dms_name, args.column_name, version_number=args.version_number)
# check that 1 element / line and summable type?
total = 0
for count in c :
total+=count
print("Total count = ", total)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment