################################
##  Set diagnostics to True   ##
##  If you want display the   ##
##      Tracking process.     ##
################################

diagnostics=False

#################################
##      Import packages        ##
#################################
import sys
import os

from trackeddy.tracking import *
from trackeddy.savedata import *
from numpy import *
from pylab import *
import random
import pytest

#################################
##   Import tools to create    ##
##     syntetic fields         ##
#################################

from trackeddy.utils.gaussian_field_functions import *
import trackeddy.utils.field_generator as fg

n=2
a  = 0.1
b  = 0.1
t0 = 0
t  = 1

xx=linspace(10,12,200)
yy=linspace(10,12,200)

gf=fg.Generate_field(a,b,n,xx,yy,'Nint')   

data = abs(gf.assemble_field(t))

x=linspace(10,13,300)
y=linspace(10,13,300)
        
preferences={'ellipse':0.85,'eccentricity':0.85,'gaussian':0.8}
eddytd={}
eddytdn={}

levels = {'max':data.max(),'min':0.1,'step':0.1}
eddytd = analyseddyzt(data,x,y,t0,t,1,levels,preferences=preferences,areamap='',mask='',maskopt='forcefit'\
                    ,destdir='',physics='',diagnostics=False,plotdata=False,pprint=True,debug=False)



@pytest.mark.ttrackeddy1
def test_data2npy():
    save_data('./test.npy', eddytd)
    assert os.path.isfile('./test.npy')

@pytest.mark.ttrackeddy1
def test_tracknpy2nc():
    track2nc = Trackeddy2dataset('./test.npy','./','nc')
    track2nc.file2dict()
    track2nc.trackeddy2nc()
    assert os.path.isfile('./output_000.nc')

@pytest.mark.ttrackeddy1
def test_trackdata2nc():
    track2nc = Trackeddy2dataset(eddytd,'./','nc')
    track2nc.trackeddy2nc()
    assert os.path.isfile('./output_001.nc')

os.remove('./test.npy')
os.remove('./test.nc')
os.remove('./output_000.nc')
os.remove('./output_001.nc')
@@ -435,16 +435,28 @@
 t pytest
+%0Aimport time
 %0A%0A######
@@ -1249,17 +1249,16 @@
 alse)%0A%0A%0A
-%0A
 @pytest.
@@ -1264,33 +1264,37 @@
 .mark.ttrackeddy
-1
+_save
 %0Adef test_data2n
@@ -1372,24 +1372,25 @@
 test.npy')%0A%0A
+%0A
 @pytest.mark
@@ -1392,33 +1392,37 @@
 .mark.ttrackeddy
-1
+_save
 %0Adef test_trackn
@@ -1586,16 +1586,17 @@
 0.nc')%0A%0A
+%0A
 @pytest.
@@ -1610,17 +1610,21 @@
 rackeddy
-1
+_save
 %0Adef tes
@@ -1770,32 +1770,62 @@
 ')%0A%0A
-os.remove('./test.npy')%0A
+@pytest.mark.ttrackeddy_save%0Adef test_rm_files():%0A    
 os.r
@@ -1839,20 +1839,25 @@
 ./test.n
-c
+py
 ')%0A
+    
 os.remov
@@ -1877,16 +1877,20 @@
 00.nc')%0A
+    
 os.remov

Solve savedata bug