Configuring the new tag for pyPI release

This commit is contained in:
Petrônio Cândido 2018-03-06 19:47:14 -03:00
parent 11831b9769
commit a9a07204dc
13 changed files with 29 additions and 54 deletions

View File

@ -9,7 +9,7 @@ def get_data():
return dat
def get_dataframe():
dat = common.get_dataframe('data/AirPassengers.csv',
dat = common.get_dataframe('AirPassengers.csv',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/AirPassengers.csv',
sep=",")
return dat

View File

@ -10,7 +10,7 @@ def get_data():
def get_dataframe():
dat = common.get_dataframe('data/Enrollments.csv',
dat = common.get_dataframe('Enrollments.csv',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/Enrollments.csv',
sep=";")
return dat

View File

@ -18,7 +18,7 @@ import pandas as pd
def get_dataframe():
dat = common.get_dataframe('data/INMET.csv.bz2',
dat = common.get_dataframe('INMET.csv.bz2',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/INMET.csv.bz2',
sep=";", compression='bz2')
dat["DataHora"] = pd.to_datetime(dat["DataHora"], format='%d/%m/%Y %H:%M')

View File

@ -10,7 +10,7 @@ def get_data(field):
def get_dataframe():
dat = common.get_dataframe('data/NASDAQ.csv.bz2',
dat = common.get_dataframe('NASDAQ.csv.bz2',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/NASDAQ.csv.bz2',
sep=";", compression='bz2')
return dat

View File

@ -10,7 +10,7 @@ def get_data(field):
def get_dataframe():
dat = common.get_dataframe('data/SONDA_BSB.csv.bz2',
dat = common.get_dataframe('SONDA_BSB.csv.bz2',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/SONDA_BSB.csv.bz2',
sep=";", compression='bz2')
dat["datahora"] = pd.to_datetime(dat["datahora"], format='%Y-%m-%d %H:%M:%S')

View File

@ -4,7 +4,7 @@ import numpy as np
def get_dataframe():
dat = common.get_dataframe('data/SP500.csv.bz2',
dat = common.get_dataframe('SP500.csv.bz2',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/SP500.csv.bz2',
sep=",", compression='bz2')
dat = np.array(dat["Avg"])

View File

@ -10,7 +10,7 @@ def get_data():
def get_dataframe():
dat = common.get_dataframe('data/TAIEX.csv.bz2',
dat = common.get_dataframe('TAIEX.csv.bz2',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/TAIEX.csv.bz2',
sep=",", compression='bz2')
dat["Date"] = pd.to_datetime(dat["Date"])

View File

@ -6,8 +6,8 @@ from pathlib import Path
from urllib import request
def get_dataframe(path, url, sep=";", compression='infer'):
filename = pkg_resources.resource_filename('pyFTS', path)
def get_dataframe(filename, url, sep=";", compression='infer'):
#filename = pkg_resources.resource_filename('pyFTS', path)
tmp_file = Path(filename)
if tmp_file.is_file():

View File

@ -8,7 +8,7 @@ def get_data():
return dat
def get_dataframe():
dat = common.get_dataframe('data/sunspots.csv',
dat = common.get_dataframe('sunspots.csv',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/sunspots.csv',
sep=",")
return dat

View File

@ -106,7 +106,8 @@ class TimeGridPartitioner(partitioner.Partitioner):
ax.set_xlim([0, self.season.value])
ticks = []
x = []
for s in self.sets:
for key in self.sets.keys():
s = self.sets[key]
if s.type == 'composite':
for ss in s.sets:
self.plot_set(ax, ss)

View File

@ -66,28 +66,29 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/petronio/dados/Dropbox/Doutorado/Codigos/pyFTSsource/pyFTS/notebooks/teste\n"
"ename": "PermissionError",
"evalue": "[Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/pyFTS/data/Enrollments.csv'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mPermissionError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-c717b3ec41cd>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mpyFTS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mEnrollments\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0menrollments\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEnrollments\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pyFTS/data/Enrollments.py\u001b[0m in \u001b[0;36mget_data\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mget_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mdat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_dataframe\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mdat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdat\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"Enrollments\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdat\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pyFTS/data/Enrollments.py\u001b[0m in \u001b[0;36mget_dataframe\u001b[0;34m()\u001b[0m\n\u001b[1;32m 13\u001b[0m dat = common.get_dataframe('data/Enrollments.csv',\n\u001b[1;32m 14\u001b[0m \u001b[0;34m'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/Enrollments.csv'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 15\u001b[0;31m sep=\";\")\n\u001b[0m\u001b[1;32m 16\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdat\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pyFTS/data/common.py\u001b[0m in \u001b[0;36mget_dataframe\u001b[0;34m(path, url, sep, compression)\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msep\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcompression\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcompression\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0mrequest\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0murlretrieve\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 17\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msep\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcompression\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcompression\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.6/urllib/request.py\u001b[0m in \u001b[0;36murlretrieve\u001b[0;34m(url, filename, reporthook, data)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[0;31m# Handle temporary file setup.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 257\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 258\u001b[0;31m \u001b[0mtfp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'wb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 259\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[0mtfp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtempfile\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNamedTemporaryFile\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdelete\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mPermissionError\u001b[0m: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/pyFTS/data/Enrollments.csv'"
]
}
],
"source": [
"#from pyFTS.data import Enrollments\n",
"from pyFTS.data import Enrollments\n",
"\n",
"#enrollments = Enrollments.get_data()\n",
"\n",
"import pandas as pd\n",
"import numpy as np\n",
"import os\n",
"import pkg_resources\n",
"from pathlib import Path\n",
"from urllib import request\n",
"enrollments = Enrollments.get_data()\n",
"\n"
]
},

File diff suppressed because one or more lines are too long

View File

@ -1,30 +1,4 @@
from distutils.core import setup
from distutils.command.install import install as _install
class install(_install):
def run(self):
_install.run(self)
from pyFTS.data import INMET,Enrollments,AirPassengers,NASDAQ,SONDA,SP500,sunspots,TAIEX
print("Downloading data assets:")
print("TAIEX")
TAIEX.get_data()
print("sunspots")
sunspots.get_data()
print("SP500")
SP500.get_dataframe()
print("SONDA")
SONDA.get_dataframe()
print("NASDAQ")
NASDAQ.get_dataframe()
print("AirPassengers")
AirPassengers.get_data()
print("Enrollments")
Enrollments.get_data()
print("INMET")
INMET.get_dataframe()
setup(
name='pyFTS',
@ -35,7 +9,7 @@ setup(
#package_data={'pyFTS.data': ['*.csv','*.csv.bz2']},
#data_files=[('data', ['pyFTS/data/Enrollments.csv', 'pyFTS/data/AirPassengers.csv'])],
#include_package_data=True,
version='1.2.0',
version='1.2.1',
description='Fuzzy Time Series for Python',
author='Petronio Candido L. e Silva',
author_email='petronio.candido@gmail.com',
@ -48,5 +22,4 @@ setup(
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
cmdclass={'install': install},
)