Skip to main content

各种实用功能,用于处理从 Selectronics 的 SP-LINK 程序下载的数据,该程序与其太阳能逆变器控制器进行通信。

项目描述

各种实用功能,用于处理从 Selectronics 的 SP-LINK 程序下载的数据,该程序与其太阳能逆变器控制器进行通信。

最新版本 20220918

  • SPLinkData.plot:将key_specs关键字参数重命名为强制位置data_specs参数。
  • SPLinkData.resolve:接受多个规范字符串。
  • 新的 SPLinkData.plot_data_from_spec(start,stop,data_spec,...) 方法返回 PlotSeries 实例的列表。
  • SPLinkData.plot:放置模式参数(未使用)。
  • SPLinkData.plot:处理绘图数据并使用样式进行注释,调用 Axes.plot 或 Axes.stackplot 而不是 DataFrame.plot。
  • SPLinkData.plot: axes() 现在有更好的默认大小,放弃我们自己的默认大小。
  • SPLinkData.plot:新的可选 ax_title 参数,用于指定轴的标题。
  • SPLinkCommand.cmd_plot:将伪数据“POWER”设为“POWER”的默认和特殊情况的堆栈图。

我用它来收集和绘制来自我的太阳能逆变器的数据。

功能main(argv=None)

SP-Link 命令行模式。

班级SPLinkCommand(cs.timeseries.TimeSeriesBaseCommand, cs.cmdutils.BaseCommand)

用于处理 SP-Link 数据下载的命令行。

命令行用法:

Usage: splink [-d spdpath] [-n] subcommand...
    -d spdpath  Specify the directory containing the SP-Link downloads
                and time series. Default from $SPLINK_DATADIR,
                or '.'.
    -n          No action; recite planned actions.
  Subcommands:
    export dataset
      Export the named dataset in the original CSV form.
      Available datasets: DailySummaryData DetailedData
    fetch [-F rsync-source] [-nx] [-- [rsync-options...]]
      Rsync everything from rsync-source into the downloads area.
      -F    Fetch rsync source, default from $SPLINK_FETCH_SOURCE.
      -n    Passed to rsync. Just more convenient than putting it at the end.
      -x    Delete source files.
    help [-l] [subcommand-names...]
      Print the full help for the named subcommands,
      or for all subcommands if no names are specified.
      -l  Long help even if no subcommand-names provided.
    import [-d dataset,...] [-n] [sp-link-download...]
      Import CSV data from the downloads area into the time series data.
      -d datasets       Comma separated list of datasets to import.
                        Default datasets: DailySummaryData DetailedData EventData
      -f                Force. Import datasets even if already marked as
                        imported.
      -n                No action. Recite planned imports.
      sp-link-download  Specify specific individual downloads to import.
                        The default is any download not tagged as already
                        imported.
    info
      Report infomation about the time series stored at tspath.
    plot [-e event,...] [-f] [-o imagepath] [--show] start-time [stop-time] {mode|[dataset:]{glob|field}}...
      Plot the data from specified fields for the specified time range.
      Options:
        --bare          Strip axes and padding from the plot.
        -e events,...   Display the specified events.
        -f              Force. Overwirte the image path even if it exists.
        --stacked       Stack graphed values on top of each other.
        -o imagepath    Write the plot to imagepath.
                        If not specified, the image will be written
                        to the standard output in sixel format if
                        it is a terminal, and in PNG format otherwise.
        --show          Open the image path with "open".
        --tz tzspec     Skew the UTC times presented on the graph
                        to emulate the timezone specified by tzspec.
                        The default skew is the system local timezone.
        start-time      An integer number of days before the current time
                        or any datetime specification recognised by
                        dateutil.parser.parse.
        stop-time       Optional stop time, default now.
                        An integer number of days before the current time
                        or any datetime specification recognised by
                        dateutil.parser.parse.
        mode            A named graph mode, implying a group of fields.
    pull [-d dataset,...] [-F rsync-source] [-nx]
      Fetch and import data.
      -d dataset,...
            Specify the datasets to import.
      -F    Fetch rsync source, default from $SPLINK_FETCH_SOURCE.
      -n    No action; pass -n to rsync. Just more convenient than putting it at the end.
      -x    Delete source files.

班级SPLinkCSVDir(cs.fs.HasFSPath)

用于处理 SP-Link 数据下载的类,指的是特定的PerformanceData*下载目录。

班级SPLinkData(cs.fs.HasFSPath, cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin)

包含 SP-Link 数据的目录。

这包含:

  • downloads: 包含各种 SP-Link 下载副本的目录,即包含名为PerformanceData_*.
  • events.dbEventData:来自CSV 文件的累积事件数据
  • DailySummaryData:包含来自CSV 文件SPLinkDataDir的累积数据DailySummaryData
  • DetailedData:包含来自CSV 文件SPLinkDataDir的累积数据DetailedData

班级SPLinkDataDir(cs.timeseries.TimeSeriesDataDir, cs.timeseries.TimeSeriesMapping, builtins.dict, cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin, cs.fs.HasFSPath, cs.configutils.HasConfigIni, cs.timeseries.HasEpochMixin, cs.timeseries.TimeStepsMixin)

ATimeSeriesDataDir保存来自 SP-Link CSV 数据下载的日志数据。这包含来自特定 CSV 日志的数据,例如'DetailedData'. 该类SPLinkData管理其中的几个以及一个下载子目录和一个事件SQLTags

方法SPLinkDataDir.__init__(self, dirpath, dataset: str, step: int, policy=None, **kw):初始化SPLinkDataDir.

参数:

  • dirpath:保存下载的 CSV 文件的目录的路径名
  • dataset: 哪个 CSV 文件填充了这个时间序列,例如'DetailedData'
  • step: 可选时间序列步长,默认SPLinkDataDir.DEFAULT_LOG_FREQUENCY,来自SPLinkCSVDir.DEFAULT_LOG_FREQUENCY
  • policy: 可选 TimespanPolicy instance; if omitted anTimespanPolicyYearly instance will be made Other keyword arguments are passed to theTimeSeriesDataDir` 初始化器。

班级SPLinkDataFileInfo(builtins.tuple)

SPLinkDataFileInfo(fspath、站点名称、数据集、unixtime、dotext)

方法SPLinkDataFileInfo.__new__(_cls, fspath, sitename, dataset, unixtime, dotext):创建 SPLinkDataFileInfo(fspath, sitename, dataset, unixtime, dotext) 的新实例

功能ts2001_unixtime(tzname=None)

将 SP-Link seconds-since-2001-01-01-local-time 偏移量转换为 UNIX 时间。

发布日志

发布 20220918

  • SPLinkData.plot:将key_specs关键字参数重命名为强制位置data_specs参数。
  • SPLinkData.resolve:接受多个规范字符串。
  • 新的 SPLinkData.plot_data_from_spec(start,stop,data_spec,...) 方法返回 PlotSeries 实例的列表。
  • SPLinkData.plot:放置模式参数(未使用)。
  • SPLinkData.plot:处理绘图数据并使用样式进行注释,调用 Axes.plot 或 Axes.stackplot 而不是 DataFrame.plot。
  • SPLinkData.plot: axes() 现在有更好的默认大小,放弃我们自己的默认大小。
  • SPLinkData.plot:新的可选 ax_title 参数,用于指定轴的标题。
  • SPLinkCommand.cmd_plot:将伪数据“POWER”设为“POWER”的默认和特殊情况的堆栈图。

发布 20220806:在导入期间更快的事件预扫描(似乎时间戳是唯一的),更少的导入噪音。

发布 20220805

  • SPLinkCommand.cmd_plot:新的 --bare 选项,用于从图形中去除图例、轴等。
  • 各种小的内部变化。

发布 20220626

  • 导入过程的大量更新。
  • SPLinkCommand:新的 cmd_pull,结合了 fetch 和 import。
  • SPLinkData.plot:重做关键匹配和绘图数据收集,将 utcoffset 传递给附属时间序列绘图调用。
  • SPLinkDataDir.to_csv: shim TimeSeriesDataDir,to_csv 以重现 SP-Link 下载 CSV 格式。
  • SPLinkCommand.cmd_export:新的“splink export”命令以 SP-Link CSV 格式导出数据。
  • 许多小的更新。

版本 20220606:初始 PyPI 版本。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

cs.splink-20220918.tar.gz (18.6 kB 查看哈希

已上传 source

内置分布

cs.splink-20220918-py3-none-any.whl (15.6 kB 查看哈希

已上传 py3