Code Monkey home page Code Monkey logo

fablabbcn / smartcitizen-data Goto Github PK

View Code? Open in Web Editor NEW
12.0 20.0 9.0 103.1 MB

A python package for analyzing environmental sensor's data

Home Page: https://docs.smartcitizen.me/Data/Data%20Analysis/

License: GNU General Public License v3.0

Jupyter Notebook 27.83% Python 65.97% Smarty 2.26% HTML 3.93% Dockerfile 0.01%
data-science data-analysis machine-learning smartcitizen sensors low-cost-sensor sensor-data environmental-monitoring air-quality python

smartcitizen-data's People

Contributors

anmolter avatar dwaipayan05 avatar mcsage avatar oscgonfer avatar pral2a avatar vicobarberan avatar viktorsmari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartcitizen-data's Issues

Uplot Issue

TypeError                                 Traceback (most recent call last)
Cell In[11], [line 7](vscode-notebook-cell:?execution_count=11&line=7)
      [1](vscode-notebook-cell:?execution_count=11&line=1) traces = {
      [2](vscode-notebook-cell:?execution_count=11&line=2)             "1": {"devices": "all",
      [3](vscode-notebook-cell:?execution_count=11&line=3)                   "channel": "BATT",
      [4](vscode-notebook-cell:?execution_count=11&line=4)                   "subplot": 1}
      [5](vscode-notebook-cell:?execution_count=11&line=5)         }
----> [7](vscode-notebook-cell:?execution_count=11&line=7) test.ts_uplot(traces = traces, 
      [8](vscode-notebook-cell:?execution_count=11&line=8)               formatting = {'width':1000, 
      [9](vscode-notebook-cell:?execution_count=11&line=9)                             'title': 'Battery discharge test', 
     [10](vscode-notebook-cell:?execution_count=11&line=10)                             'ylabel': {1: 'Battery level (%)'}
     [11](vscode-notebook-cell:?execution_count=11&line=11)                            }, 
     [12](vscode-notebook-cell:?execution_count=11&line=12)               options = {'frequency': '1Min'})

File ...Programs\Python\Python311\Lib\site-packages\scdata\test\plot\ts_uplot.py:115, in ts_uplot(self, **kwargs)
    [113](file:Programs/Python/Python311/Lib/site-packages/scdata/test/plot/ts_uplot.py:113) # Get data in uplot expected format
    [114](file:Programs/Python/Python311/Lib/site-packages/scdata/test/plot/ts_uplot.py:114) udf = df.copy()
--> [115](file:Programs/Python/Python311/Lib/site-packages/scdata/test/plot/ts_uplot.py:115) udf.index = udf.index.astype(int)/10**9
    [117](file:Programs/Python/Python311/Lib/site-packages/scdata/test/plot/ts_uplot.py:117) for isbplt in range(n_subplots):
    [119](file:Programs/Python/Python311/Lib/site-packages/scdata/test/plot/ts_uplot.py:119)     sdf = udf.loc[:, subplots[isbplt]]

File...Programs\Python\Python311\Lib\site-packages\pandas\core\indexes\base.py:1087, in Index.astype(self, dtype, copy)
   [1085](file:Programs/Python/Python311/Lib/site-packages/pandas/core/indexes/base.py:1085) if isinstance(values, ExtensionArray):
   [1086](file:Programs/Python/Python311/Lib/site-packages/pandas/core/indexes/base.py:1086)     with rewrite_exception(type(values).__name__, type(self).__name__):
...
    [485](file:Programs/Python/Python311/Lib/site-packages/pandas/core/arrays/datetimelike.py:485)     )
    [487](file:Programs/Python/Python311/Lib/site-packages/pandas/core/arrays/datetimelike.py:487) if copy:
    [488](file:Programs/Python/Python311/Lib/site-packages/pandas/core/arrays/datetimelike.py:488)     values = values.copy()

TypeError: Converting from datetime64[ns, Europe/Madrid] to int32 is not supported. Do obj.astype('int64').astype(dtype) instead

Missing src/secrets?

When attempting to import src/data/api (for example), I get the following error. Is there a place to find the missing code?

ModuleNotFoundError                       
Traceback (most recent call last)
<ipython-input-1-37165e7e045a> in <module>
----> 1 from src.data import api

~\Desktop\projects\smartcitizen-iscape-data\src\data\api.py in <module>
      1 import requests
      2 from tzwhere import tzwhere
----> 3 from src.saf import *
      4 
      5 API_BASE_URL='https://api.smartcitizen.me/v0/devices/'

~\Desktop\projects\smartcitizen-iscape-data\src\saf.py in <module>
     15 
     16 import joblib
---> 17 from src.secrets import *
     18 from src.models.formulas import *
     19 

ModuleNotFoundError: No module named 'src.secrets'

How to deal with data dir

The framework makes use of a data directory to hold calibration, blueprints and local data sources as raw and processed data, models and so on.

With the changes by @mcsage, for setup.py, the data folder could not be used properly since:

  1. it could grow if data and models are accumulated in it and go unadvertised for someone that doesn't know where to look for
  2. it could be rendered inaccessible if moved to the site-packages as a package_data folder

So, should we include a step to make a ~/.scdata/data folder in which or another configurable directory in an .env file? @mcsage any proposal?

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.