profile
viewpoint
遗忘

erijo/transparent-proxy 48

A basic transparent HTTP proxy

erijo/tellcore-py 42

Python wrapper for Telldus' home automation library Telldus Core

erijo/sunnyportal-py 19

Python module to access PV systems in Sunny Portal

erijo/xsonrpc 14

An XML/JSON RPC library for C++11

erijo/tellive-py 12

Python wrapper for Telldus Live

erijo/energy-utils 3

A collection of python utils related to energy.

erijo/py-svndump 3

Python module for parsing subversion dumpfile

erijo/hotspot 1

The Linux perf GUI for performance analysis.

erijo/telldus 1

This is a mirror for Telldus main repository

erijo/bitwise 0

Terminal based bit manipulator in ncurses

Pull request review commentcurl/curl

CURL_PUSH_ERROROUT: allow the push callback to fail the parent stream

 static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,   case NGHTTP2_PUSH_PROMISE:     rv = push_promise(data_s, conn, &frame->push_promise);     if(rv) { /* deny! */-      rv = nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE,+      int h2;+      DEBUGASSERT((rv > CURL_PUSH_OK) && (rv < CURL_PUSH_ERROROUT));

Same here, shouldn't this be <= as well?

bagder

comment created time in 2 days

push eventerijo/energy-utils

Erik Johansson

commit sha 043a6c357b505af54b5fba64887aa9b2f3d464f5

Add tibber.py and tibber2pvoutput to the README

view details

push time in 3 days

push eventerijo/energy-utils

Erik Johansson

commit sha ab1339f11ed2a56ae08b5e6cc8a9a3162f09f72d

Format all Python code with black

view details

Erik Johansson

commit sha 8981fedd6053742aa35fa63c58070da6a9aa6ddc

tibber: initial version to get consumption and production

view details

Erik Johansson

commit sha 40183a92cd0f90eaa6107705b0e3a96b42067579

pvoutput: use != "" instead of is not ""

view details

Erik Johansson

commit sha 2779fd353aacada118b101aeaa2c3151c4bc7ac7

tibber2pvoutput: first working version

view details

push time in 3 days

issue commenterijo/energy-utils

Adapt to the changes on eon.se

I will instead use the official APIs from Tibber to get the data I want.

erijo

comment created time in 8 days

issue closederijo/energy-utils

Adapt to the changes on eon.se

Eon.se changed their site which broke eon.py which now needs to be updated.

closed time in 8 days

erijo

push eventerijo/energy-utils

Erik Johansson

commit sha 7466aa6388adbe108f88c2d89d9a4c95a2d9ac33

eon: Dump of WIP to support the new "Mitt E.ON" Log in seems to work, but something is missing as no authorization token is received. But I will leave it at this for now and explore other alterantives instead. See #2.

view details

Erik Johansson

commit sha 1552be7fddde15923dc81c993381c6b98f6e503a

Remove E.ON support as it doesn't work with the new "Mitt E.ON"

view details

push time in 8 days

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 77e38b6bff270a0a2733e4d850247ae20ed8eb2c

Report all imported engery as "Import Peak"

view details

push time in 10 days

push eventerijo/sunnyportal-py

Erik Johansson

commit sha ad7529d69c658deb3325c17253c3dd783615893e

Add support for getting energy balance for a single day

view details

Erik Johansson

commit sha 94a6e12af6649716394499d5e31bdd7445dbd433

sunnyportal2pvoutput: add -c parameter to report consumption If the plant supports "energy balance", -c can be used to report consumption to pvoutput. Fixes #14.

view details

Erik Johansson

commit sha bd616c802f446b02e58afe0e966d11aadebcea42

sunnyportal2pvoutput: Remember which plant that's used and have the user pick which one to use if there are more than one.

view details

push time in 11 days

issue closederijo/sunnyportal-py

Extend sunnyportal2pvoutput with support for energy balance

In 2383d214 support was added to get the "energy balance" from sunny portal. This includes both consumption and generation and if supported, it would be good to use this as the source to upload to pvoutput.

closed time in 11 days

erijo

issue openederijo/energy-utils

Adapt to the changes on eon.se

Eon.se changed their site which broke eon.py which now needs to be updated.

created time in 11 days

issue openederijo/sunnyportal-py

Extend sunnyportal2pvoutput with support for energy balance

In 2383d214 support was added to get the "energy balance" from sunny portal. This includes both consumption and generation and if supported, it would be good to use this as the source to upload to pvoutput.

created time in 11 days

issue commenterijo/sunnyportal-py

Getting temperature and Irradiance

I think you need to experiment a bit with the existing methods and see if any of those returns something that looks like it could include the data you want. In 6bfd33af I added support for getting devices for a solar plant and their parameters. Perhaps you can try and see if the hardware that measures the temperature and irradiance is reported as a special device. Enable the debug code in testclient.py to get the parameters and look at the XML in the debug log and see if you can find the device you're looking for.

Cuervocartoon

comment created time in 11 days

pull request commenterijo/sunnyportal-py

Added handling of illegal characters in plant name

Thanks!

joebe975

comment created time in 11 days

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 2c1365f9764b207ddd2c2f102e4852ee6d82e6a7

Format sunnyportal2file with black (make black)

view details

push time in 11 days

push eventerijo/sunnyportal-py

Joel Berglund

commit sha 26cf108a86d8f7db7295e440ec2ff7ef21a1f45b

Added handling of illegal characters in plant name

view details

Erik Johansson

commit sha bbfe171534e2d06a5394a98264c81fae72a063ff

Merge pull request #13 from joebe975/master Added handling of illegal characters in plant name

view details

push time in 11 days

PR merged erijo/sunnyportal-py

Added handling of illegal characters in plant name

Plant names can contain illegal characters which becomes problematic when saving to file with sunnyportal2file. Instead of handling per OS, I just assumed worst case OS, thus the characters <>:"/|?*. Those characters will be replaced by underscore in the name handling.

+17 -5

0 comment

1 changed file

joebe975

pr closed time in 11 days

Pull request review commentcurl/curl

CURL_PUSH_ERROROUT: allow the push callback to fail the parent stream

 static int push_promise(struct Curl_easy *data,     stream->push_headers_used = 0;      if(rv) {+      DEBUGASSERT((rv > CURL_PUSH_OK) && (rv < CURL_PUSH_ERROROUT));

Shouldn't it be <= instead of <?

bagder

comment created time in 13 days

delete branch erijo/ccache

delete branch : stale-license

delete time in 23 days

delete branch erijo/xxHash

delete branch : dispatch-defines

delete time in 23 days

delete branch erijo/xxHash

delete branch : ndebug

delete time in 23 days

PR opened Cyan4973/xxHash

Dispatch defines

Make it possible to build xxh_x86dispatch.c with XXH_DISPATCH_AVX and/or XXH_DISPATCH_AVX512 undefined.

+36 -1

0 comment

1 changed file

pr created time in 23 days

create barncherijo/xxHash

branch : dispatch-defines

created branch time in 23 days

PR opened Cyan4973/xxHash

Fix redefinition warning when NDEBUG is defined during build
+1 -0

0 comment

1 changed file

pr created time in 23 days

create barncherijo/xxHash

branch : ndebug

created branch time in 23 days

fork erijo/xxHash

Extremely fast non-cryptographic hash algorithm

http://www.xxhash.com/

fork in 23 days

PR opened ccache/ccache

Remove stale licenses

The m4 files are no longer used after the switch to cmake in f2341b2.

<!-- Thanks for contributing to ccache! Please read https://github.com/ccache/ccache/blob/master/CONTRIBUTING.md#contributing-code before submitting the pull request.

Please describe what the pull request is about. If it fixes a bug or implements a feature that exists as a ccache issue, state which one. If it implements a feature, please describe what it does and motivate why you think that it would be a good idea for ccache. -->

+0 -349

0 comment

1 changed file

pr created time in 24 days

create barncherijo/ccache

branch : stale-license

created branch time in 24 days

issue openedccache/ccache

Replace XXH64 with XXH3?

<!-- Describe below how you want ccache to work or behave: -->

XXH3 is the new version of xxHash which, according to the creators themselves:

The new algorithm is much faster than its predecessors for both long and small inputs...

The hash is not yet officially released:

XXH3 has now reached "release candidate" status. If everything remains fine, its format will be "frozen" and become final. After which, return values of XXH3 and XXH128 will no longer change in future versions. XXH3's return values will be officially finalized upon reaching v0.8.0.

I've done a test switch and a simple performance comparison with master (using ../misc/performance /usr/bin/g++ -std=c++11 -I../src -I. ../src/ccache.cpp):

master:

Without ccache:                             1.1885 s (100.0000 %) (  1.0000 x)
With ccache, preprocessor mode, cache miss: 1.2636 s (106.3222 %) (  0.9405 x)
With ccache, preprocessor mode, cache hit:  0.0882 s (  7.4190 %) ( 13.4788 x)
With ccache, direct mode, cache miss:       1.2629 s (106.2667 %) (  0.9410 x)
With ccache, direct mode, cache hit:        0.0123 s (  1.0313 %) ( 96.9686 x)
With ccache, depend mode, cache miss:       1.3072 s (109.9887 %) (  0.9092 x)
With ccache, depend mode, cache hit:        0.0125 s (  1.0528 %) ( 94.9887 x)

xxh3:

Without ccache:                             1.1654 s (100.0000 %) (  1.0000 x)
With ccache, preprocessor mode, cache miss: 1.2527 s (107.4882 %) (  0.9303 x)
With ccache, preprocessor mode, cache hit:  0.0876 s (  7.5122 %) ( 13.3117 x)
With ccache, direct mode, cache miss:       1.2614 s (108.2318 %) (  0.9239 x)
With ccache, direct mode, cache hit:        0.0118 s (  1.0156 %) ( 98.4625 x)
With ccache, depend mode, cache miss:       1.2559 s (107.7648 %) (  0.9279 x)
With ccache, depend mode, cache hit:        0.0119 s (  1.0187 %) ( 98.1689 x)

The performance improvement seems minor, but a bit more testing is probably needed.

created time in 24 days

create barncherijo/ccache

branch : xxh3

created branch time in 24 days

push eventerijo/ccache

Erik Johansson

commit sha df961358240487afdc4a92eb4bc7db25e6f931de

Avoid duplicate stat calls (#550) hash_source_code_string will, in read_file, stat the file to get the file size. But when called from verify_result, the file size is already known so by using this size the number of stat calls in a normal run can be cut in half.

view details

Erik Johansson

commit sha ed45b522a79e383a257eb7759414ed2943a97fc5

Read/write optimizations (#551) * Avoid one extra read call after the final bytes are read If read returns less then the requested number of bytes, the file is at EOF. This can be used in all places where a read is done, but it makes extra impact in read_file where if the buffer is made one byte bigger than needed, EOF can be detected before a unnecessary memory reallocation is done. * Use write instead of fwrite to write the result file This avoids the caching in stdio where a write is split into two (at least on my system): first a small 4k one and then one with the remaining 60k.

view details

Thomas Otto

commit sha 16bc3affc4668f20f173aa9c832cd70b542ed937

Convert the single ofstream use to fwrite (#552)

view details

Thomas Otto

commit sha 203c0e112754f4c313390fa6f0e1a9fb5921e49f

Convert counters to a class (#548) Also remove file writing logic from `stats_update_size()` and delete unused declaration of `stats_timestamp()`.

view details

Joel Rosdahl

commit sha e2cb5f8f3fdd183872703dbdbf8be63f5e02c7d9

Let development version be BRANCH.SHORTHASH Previously the version of a master-based development build was something like 3.7.1+NNN_gSHORTHASH which is a bit misleading.

view details

Joel Rosdahl

commit sha 6aba3fb3b48e8dc4919b29b6807a63007ee705eb

Rewrite absolute input path to relative This can now be done due to no longer using realpath in make_relative_path (e8444a38).

view details

Joel Rosdahl

commit sha 41425fc94b1df95d36c3254db5b67e29c257cb6b

Cap time to sleep to 10 ms when failing to acquire a lock (cherry picked from commit 41ffc7ec009237da51040c6059b1bcd7903af30d)

view details

Joel Rosdahl

commit sha 01de3d5c703407d658c5adcd753d4fc5da89ba3d

Rewrite the Windows version of the lockfile routines Instead of emulating the POSIX version, use the native Windows file API to create a lockfile. This should mitigate several problems with the old implementation. Hopefully fixes #537. (cherry picked from commit 53b9fdd6272896bb4a2dc42c9680d4030f86b33c)

view details

Joel Rosdahl

commit sha c468acbf200a5352ac34f798107241d49500d533

Simplify lock breaking Acquiring a .lock.lock file does not make lock breaking significantly safer; there is still a race condition. Simplify it by simply deleting the lockfile when breaking and try to acquire it again.

view details

Joel Rosdahl

commit sha c181fdd983376014e6c27b6e0b64af9a7e0eb7e3

C++-ify lockfile routines

view details

Joel Rosdahl

commit sha 67e0b816fe17b521aae700de16467df0f51c064f

Use tmp_unlink to remove temporary file in use_relative_paths_in_depfile No need to remove via another temporary file. (cherry picked from commit c74b625aaa46db85797a691c81f129834c7fd82e)

view details

Thomas Otto

commit sha 2e7154e67a5dd56852dae29d4c418d4ddc07c230

CacheEntryReader: Fix return type (#554)

view details

Joel Rosdahl

commit sha 6080b1e8a6fce1216e8c9c943c76c78d1f87681e

doc: Clarify include_file_ctime sloppiness in the Performance section (cherry picked from commit fc8182ae95af0f46fc8f71ab29e91534636325b7)

view details

Joel Rosdahl

commit sha 71edf04aa2c72b54c3b92f92532d41d5b1f5909c

win32: Log epoch timestamp if localtime_r fails (cherry picked from commit 21fc81c11966d674c3b3cfe30ccf3cdff7f6dfee)

view details

Joel Rosdahl

commit sha e3f66e9cec3b542c1d4daa538b573920ab588b13

Prepare for v3.7.8 (cherry picked from commit ec65f9f88cf75cbd9f04d88c4a3345fb60911975)

view details

Joel Rosdahl

commit sha 3a90dbcd202b164a487c9e9b1d4608b28de37c37

Align entries in dev.mk.in

view details

Joel Rosdahl

commit sha 39fd7489defbce33eadd8457ec4a24be7ff854ed

configure: Error out if failing to download libzstd or libb2

view details

Joel Rosdahl

commit sha 7e3a6755f2c6ce17cd7d996cbefd5e37853cd916

Remove superfluous unlink before rename

view details

Joel Rosdahl

commit sha 1905d633d3e3eabcc098eafeaff115e3b36223e0

Disable hard link mode when the output object file is /dev/null When hard link mode is enabled, ccache ≥3.6 unlinks the output file before writing to it as a workaround for a bug in Clang (#331). This unfortunately means that /dev/null will be removed when building as root (don’t do that, BTW) with hard link mode enabled and /dev/null as the the output file. A similar problem exists if the dependency file is /dev/null, regardless of hard link mode. Fix this by not unlinking the output file if it’s /dev/null and by not copying files to /dev/null at all. (There is no need to handle other non-regular output files since /dev/null is the only allowed non-regular output file.) Fixes #564. (cherry picked from commit 9a794689a8ba47e79c96d6c370976448b756973c)

view details

Joel Rosdahl

commit sha 76f63d8a148bf1219b21cbb49d3963f6a776380e

Improve name of tmp file in x_unlink There is no need to generate a unique temporary name in x_unlink since we don’t care whether the temporary file is clobbered on NFS. The previous usage of tmp_string() was not quite correct since the returned string is supposed to be passed to mkstemp, not used as is. (cherry picked from commit e7776305184c9338ee97334078153f298f6cfea7)

view details

push time in 24 days

delete branch erijo/ccache

delete branch : blake3

delete time in 24 days

push eventerijo/ccache

Joel Rosdahl

commit sha f3878ddadb8f738db53dd9d7802ad4d9134c0c86

Allow the config file to be a symlink Fixes #607. (cherry picked from commit 46172c8bc24799ae35cf300b0b5ba765bd40896a)

view details

Joel Rosdahl

commit sha 4144bda1f44d712c15c7bffa3ccecec72c093129

Add missing “#pragma once”

view details

Erik Johansson

commit sha 716f5172c3f4d01a791cf1252acf2a014ef779f4

Add BLAKE3 c sources (BLAKE3-team/BLAKE3@4c41a893) All .c (except main.c), .S and .h files from the c directory in https://github.com/BLAKE3-team/BLAKE3

view details

Erik Johansson

commit sha 03fceb6e43522186c0eaa4e26c81cbbac4713744

Add support for building BLAKE3 sources

view details

Erik Johansson

commit sha a3e951cb0b1e52607792fb8caf4e45f3fe27547d

Use BLAKE3 instead of BLAKE2b

view details

Erik Johansson

commit sha 35ecdef4f23babb49526f724099c080718e5738c

Use the same digest size for BLAKE3 as for BLAKE2b

view details

Erik Johansson

commit sha 91f58ba110520c73f75d0b11769455951deeb244

Remove libb2 (BLAKE2) support

view details

push time in a month

push eventerijo/ccache

Erik Johansson

commit sha 62565cfacef6b6a86d71096e187648c1ad3c69ed

Make sure blake3 also uses the "standard_settings"

view details

push time in a month

pull request commentccache/ccache

Replace BLAKE2b with BLAKE3

I've rebased on top of latest master, ported the build to cmake and updated to latest BLAKE3.

Running ../misc/performance /usr/bin/g++ -std=c++11 -I../src -I. ../src/ccache.cpp in my build directory results in the following when using master (53f8efff):

Without ccache:                             1.2119 s (100.0000 %) (  1.0000 x)
With ccache, preprocessor mode, cache miss: 1.3758 s (113.5180 %) (  0.8809 x)
With ccache, preprocessor mode, cache hit:  0.1021 s (  8.4253 %) ( 11.8691 x)
With ccache, direct mode, cache miss:       1.4012 s (115.6167 %) (  0.8649 x)
With ccache, direct mode, cache hit:        0.0159 s (  1.3130 %) ( 76.1634 x)
With ccache, depend mode, cache miss:       1.4119 s (116.4988 %) (  0.8584 x)
With ccache, depend mode, cache hit:        0.0160 s (  1.3173 %) ( 75.9121 x)

Compated with this when using this PR:

Without ccache:                             1.2554 s (100.0000 %) (  1.0000 x)
With ccache, preprocessor mode, cache miss: 1.4155 s (112.7486 %) (  0.8869 x)
With ccache, preprocessor mode, cache hit:  0.0916 s (  7.2974 %) ( 13.7035 x)
With ccache, direct mode, cache miss:       1.3175 s (104.9410 %) (  0.9529 x)
With ccache, direct mode, cache hit:        0.0124 s (  0.9869 %) (101.3293 x)
With ccache, depend mode, cache miss:       1.3245 s (105.4975 %) (  0.9479 x)
With ccache, depend mode, cache hit:        0.0125 s (  0.9960 %) (100.3981 x)
erijo

comment created time in a month

push eventerijo/ccache

Erik Johansson

commit sha 07b9f34536f4f167dfc8e759fd577761ee5f6676

Add BLAKE3 c sources (BLAKE3-team/BLAKE3@4c41a893) All .c (except main.c), .S and .h files from the c directory in https://github.com/BLAKE3-team/BLAKE3

view details

Erik Johansson

commit sha 499b0aaa524564bad3bc99ef5d2a8c43787bcf50

Add support for building BLAKE3 sources

view details

Erik Johansson

commit sha bb7edd02ac969a3389f01818bc66c40c53466e73

Use BLAKE3 instead of BLAKE2b

view details

Erik Johansson

commit sha 27d69d76041b262aaca1eb07f1c536f73f0d811d

Use the same digest size for BLAKE3 as for BLAKE2b

view details

Erik Johansson

commit sha 33676333838ec12e0c3c130d5c7093a2eb27d4c7

Remove libb2 (BLAKE2) support

view details

push time in a month

push eventerijo/ccache

Erik Johansson

commit sha df961358240487afdc4a92eb4bc7db25e6f931de

Avoid duplicate stat calls (#550) hash_source_code_string will, in read_file, stat the file to get the file size. But when called from verify_result, the file size is already known so by using this size the number of stat calls in a normal run can be cut in half.

view details

Erik Johansson

commit sha ed45b522a79e383a257eb7759414ed2943a97fc5

Read/write optimizations (#551) * Avoid one extra read call after the final bytes are read If read returns less then the requested number of bytes, the file is at EOF. This can be used in all places where a read is done, but it makes extra impact in read_file where if the buffer is made one byte bigger than needed, EOF can be detected before a unnecessary memory reallocation is done. * Use write instead of fwrite to write the result file This avoids the caching in stdio where a write is split into two (at least on my system): first a small 4k one and then one with the remaining 60k.

view details

Thomas Otto

commit sha 16bc3affc4668f20f173aa9c832cd70b542ed937

Convert the single ofstream use to fwrite (#552)

view details

Thomas Otto

commit sha 203c0e112754f4c313390fa6f0e1a9fb5921e49f

Convert counters to a class (#548) Also remove file writing logic from `stats_update_size()` and delete unused declaration of `stats_timestamp()`.

view details

Joel Rosdahl

commit sha e2cb5f8f3fdd183872703dbdbf8be63f5e02c7d9

Let development version be BRANCH.SHORTHASH Previously the version of a master-based development build was something like 3.7.1+NNN_gSHORTHASH which is a bit misleading.

view details

Joel Rosdahl

commit sha 6aba3fb3b48e8dc4919b29b6807a63007ee705eb

Rewrite absolute input path to relative This can now be done due to no longer using realpath in make_relative_path (e8444a38).

view details

Joel Rosdahl

commit sha 41425fc94b1df95d36c3254db5b67e29c257cb6b

Cap time to sleep to 10 ms when failing to acquire a lock (cherry picked from commit 41ffc7ec009237da51040c6059b1bcd7903af30d)

view details

Joel Rosdahl

commit sha 01de3d5c703407d658c5adcd753d4fc5da89ba3d

Rewrite the Windows version of the lockfile routines Instead of emulating the POSIX version, use the native Windows file API to create a lockfile. This should mitigate several problems with the old implementation. Hopefully fixes #537. (cherry picked from commit 53b9fdd6272896bb4a2dc42c9680d4030f86b33c)

view details

Joel Rosdahl

commit sha c468acbf200a5352ac34f798107241d49500d533

Simplify lock breaking Acquiring a .lock.lock file does not make lock breaking significantly safer; there is still a race condition. Simplify it by simply deleting the lockfile when breaking and try to acquire it again.

view details

Joel Rosdahl

commit sha c181fdd983376014e6c27b6e0b64af9a7e0eb7e3

C++-ify lockfile routines

view details

Joel Rosdahl

commit sha 67e0b816fe17b521aae700de16467df0f51c064f

Use tmp_unlink to remove temporary file in use_relative_paths_in_depfile No need to remove via another temporary file. (cherry picked from commit c74b625aaa46db85797a691c81f129834c7fd82e)

view details

Thomas Otto

commit sha 2e7154e67a5dd56852dae29d4c418d4ddc07c230

CacheEntryReader: Fix return type (#554)

view details

Joel Rosdahl

commit sha 6080b1e8a6fce1216e8c9c943c76c78d1f87681e

doc: Clarify include_file_ctime sloppiness in the Performance section (cherry picked from commit fc8182ae95af0f46fc8f71ab29e91534636325b7)

view details

Joel Rosdahl

commit sha 71edf04aa2c72b54c3b92f92532d41d5b1f5909c

win32: Log epoch timestamp if localtime_r fails (cherry picked from commit 21fc81c11966d674c3b3cfe30ccf3cdff7f6dfee)

view details

Joel Rosdahl

commit sha e3f66e9cec3b542c1d4daa538b573920ab588b13

Prepare for v3.7.8 (cherry picked from commit ec65f9f88cf75cbd9f04d88c4a3345fb60911975)

view details

Joel Rosdahl

commit sha 3a90dbcd202b164a487c9e9b1d4608b28de37c37

Align entries in dev.mk.in

view details

Joel Rosdahl

commit sha 39fd7489defbce33eadd8457ec4a24be7ff854ed

configure: Error out if failing to download libzstd or libb2

view details

Joel Rosdahl

commit sha 7e3a6755f2c6ce17cd7d996cbefd5e37853cd916

Remove superfluous unlink before rename

view details

Joel Rosdahl

commit sha 1905d633d3e3eabcc098eafeaff115e3b36223e0

Disable hard link mode when the output object file is /dev/null When hard link mode is enabled, ccache ≥3.6 unlinks the output file before writing to it as a workaround for a bug in Clang (#331). This unfortunately means that /dev/null will be removed when building as root (don’t do that, BTW) with hard link mode enabled and /dev/null as the the output file. A similar problem exists if the dependency file is /dev/null, regardless of hard link mode. Fix this by not unlinking the output file if it’s /dev/null and by not copying files to /dev/null at all. (There is no need to handle other non-regular output files since /dev/null is the only allowed non-regular output file.) Fixes #564. (cherry picked from commit 9a794689a8ba47e79c96d6c370976448b756973c)

view details

Joel Rosdahl

commit sha 76f63d8a148bf1219b21cbb49d3963f6a776380e

Improve name of tmp file in x_unlink There is no need to generate a unique temporary name in x_unlink since we don’t care whether the temporary file is clobbered on NFS. The previous usage of tmp_string() was not quite correct since the returned string is supposed to be passed to mkstemp, not used as is. (cherry picked from commit e7776305184c9338ee97334078153f298f6cfea7)

view details

push time in a month

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 3192cd98fb968722f897b5d33d483723a072b4f7

Add make target to run black

view details

push time in 2 months

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 64f8952aefb6a00c692576872af18e3c03cfc500

Black-ify all source https://pypi.org/project/black/

view details

push time in 2 months

pull request commenterijo/sunnyportal-py

Fixed wrong or outdated string matching in overview-day-total tag

Closing this due to lack of reply.

augustecolle

comment created time in 2 months

issue closederijo/sunnyportal-py

"Sunny Portal e-mail" error with cron

Great work and thanks for making this available to use.

I got it working, but when executing using cron, I get an error that says only "Sunny Portal e-mail:" when logging cron output >> /var/log/cron.log Prior to this, I had been getting the "no MTA" error so I installed postfix in local only mode. Just guessing these are tied together and the error I'm having now means it can't send the message out to the recorded "Sunny Portal e-mail" from the config file. Maybe?

I'm wondering if/how it could be made to not require the email, assuming that would take care of it.

closed time in 2 months

bstrin

pull request commenterijo/sunnyportal-py

Add sunnyportal2file

Thanks for your contribution!

joebe975

comment created time in 2 months

push eventerijo/sunnyportal-py

Joel Berglund

commit sha 652cdd051bc9d1a89a43d43df32f834646a8c6e0

Extended the namedtuple Power to also include min and max power and changed so that also timestamps with no production is included in power_measurements from DayOverviewResponse.parse.

view details

Joel Berglund

commit sha 964ab23c1190107df0b05c5172a9afe04da86acd

Initial script for downloading data from Sunny Portal to file

view details

Joel Berglund

commit sha b5e6edd871ce13c563d504a8a00e5aef108e87d5

Updated README according to sunnyportal2file

view details

Joel Berglund

commit sha deda47ac8aab54365c107ac2b99a8bbad9583ec7

Updated .gitignore with new formats

view details

Joel Berglund

commit sha 81f2b104538fdf027c0d9ab6d99ba551e956ba98

Fixed tuple field names and include_all argument to day_overview

view details

Joel Berglund

commit sha c7b38b8ba51a2f50050aa1561c098609aec31259

Changed if cases to dict

view details

Joel Berglund

commit sha 7bec61cc673e1b2c81a80439fad983d306ec9ba5

Replaced regex with datetime.strptime

view details

Joel Berglund

commit sha a08d64047e30499f2a149c4ae6e6cf091aab38cf

Added handling of case when no data is found

view details

Joel Berglund

commit sha 6a9c323f03355213d8806d3bd5feb9f6f61b638e

Small fix

view details

Erik Johansson

commit sha 81d99fcd70353605b6e65ded63d61b16176f626e

Revert changes to tuple name that is no longer valid

view details

Erik Johansson

commit sha efa192fc5f11b71d9b6bf41d93a1a2f6eb5c89ad

Remove trailing whitespace

view details

Erik Johansson

commit sha 3fa869ca31abb7993f67aa6485e55f3fb4deb321

Add sunnyportal2file (#9) The script can be used to save data from Sunny Portal to a number of different formats.

view details

push time in 2 months

PR merged erijo/sunnyportal-py

Add sunnyportal2file

The file sunnyportal2file can be used to download data from Sunny Portal to file. It currently allows 7 output format (csv, json, pickle, hdf, parquet, feather and excel). It also contains a flag --append which can be used to only download new data and append it to existing file.

+464 -2

2 comments

4 changed files

joebe975

pr closed time in 2 months

Pull request review commenterijo/sunnyportal-py

Add sunnyportal2file

+#!/usr/bin/env python3++# Copyright (c) 2020 Joel Berglund <joebe975@protonmail.com>+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License as+# published by the Free Software Foundation; either version 3 of the+# License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful, but+# WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU+# General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307+# USA++from datetime import date, datetime, timedelta+from getpass import getpass++import argparse+import configparser+import logging+import sunnyportal.client, sunnyportal.responses+import re+import os+import pandas as pd+import numpy as np++def valid_date_type(arg_date_str):+    try:+        m = re.match("(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})", arg_date_str)+        d = date(int(m.group('year')),int(m.group('month')),int(m.group('day')))

Can you use datetime.strptime instead?

joebe975

comment created time in 2 months

Pull request review commenterijo/sunnyportal-py

Add sunnyportal2file

+#!/usr/bin/env python3++# Copyright (c) 2020 Joel Berglund <joebe975@protonmail.com>+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License as+# published by the Free Software Foundation; either version 3 of the+# License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful, but+# WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU+# General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307+# USA++from datetime import date, datetime, timedelta+from getpass import getpass++import argparse+import configparser+import logging+import sunnyportal.client, sunnyportal.responses+import re+import os+import pandas as pd+import numpy as np++def valid_date_type(arg_date_str):+    try:+        m = re.match("(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})", arg_date_str)+        d = date(int(m.group('year')),int(m.group('month')),int(m.group('day')))+        if d>=date.today():+            # Sunny Portal will return values for the whole day, while setting future times as blank (interpreted as 0)+            logging.debug(f'Cannot look into the future ({d}), changing to yesterday...')+            return date.today()-timedelta(days=1)+        return d+    except ValueError:+        msg = f'Given Date {arg_date_str} not valid! Expected format, YYYY-MM-DD!'+        raise argparse.ArgumentTypeError(msg)++++class DataFrameSaver:+    def __init__(self, df, name,file_format):+        self.df = df+        self.name = name+        self.file_extension = self.file_extension_dict[file_format]+        self.previous_files = []+    file_extension_dict = {'json':'json',+                    'pickle':'pkl',+                    'csv':'csv',+                    'hdf':'h5',+                    'feather':'feather',+                    'parquet':'parquet',+                    'excel':'xlsx'}+    # Assuming the power in W is always an integer +    dtype_dict = {'timestamp':np.datetime64,+            'mean_power':np.uint32,+            'min_power':np.uint32,+            'max_power':np.uint32}++    def get_file_name(self):+        start_date = np.amin(self.df['timestamp']).strftime('%Y-%m-%d')+        end_date = np.amax(self.df['timestamp']).strftime('%Y-%m-%d')+        return f'{self.name}_from_{start_date}_to_{end_date}.{self.file_extension}'++    def remove_zero_elements(self):+        mask = self.df['mean_power']>0+        logging.debug(f'Removing rows with zero production from DataFrame ({np.sum(mask)} rows)')+        self.df = self.df.loc[mask].reset_index(drop=True)++    def read_file(self,file_name):+        pass++    def write_file(self,file_name):+        pass++    def append(self,file_name):+        logging.debug(f'Reading old dataframe from file {file_name}')+        df_old = self.read_file(file_name)+        dtype_dict = {k: self.dtype_dict[k] for k in df_old.columns.values}+        df_old = df_old.astype(dtype_dict)++        self.df = pd.concat([df_old, self.df]).reset_index(drop=True)+        self.previous_files.append(file_name)++    def save_to_file(self, remove_zero=False):+        if remove_zero:+            self.remove_zero_elements()++        if not self.df.shape[0]:+            logging.debug('Empty DataFrame. Nothing to save...')+            return+        file_name = self.get_file_name()+        logging.debug(f'Saving to file {file_name}')+        self.write_file(file_name)+        +        # Delete old files+        for old_file in self.previous_files:+            os.remove(old_file)+            logging.debug(f'File {old_file} was deleted.')++class PickleSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='pickle')+        self.kwargs = {}+    def read_file(self,file_name):+        return pd.read_pickle(file_name, **self.kwargs)++    def write_file(self,file_name):+        self.df.to_pickle(file_name, **self.kwargs)+++class JSONSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='json')+        # Change json format below+        self.kwargs = {'orient': 'table'}+        +    def read_file(self,file_name):+        return pd.read_json(file_name,**self.kwargs)++    def write_file(self,file_name):+        self.df.to_json(file_name, index=False, **self.kwargs)+++class CSVSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='csv')+        self.kwargs = {}++    def read_file(self,file_name):+        return pd.read_csv(file_name,parse_dates=['timestamp'], **self.kwargs)++    def write_file(self,file_name):+        self.df.to_csv(file_name, index=False, **self.kwargs)+++class HDFSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='hdf')+        self.kwargs = {'key':'df'}++    def read_file(self,file_name):+        return pd.read_hdf(file_name,**self.kwargs)++    def write_file(self,file_name):+        self.df.to_hdf(file_name, mode='w', **self.kwargs)+++class ParquetSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='parquet')+        self.kwargs = {}++    def read_file(self,file_name):+        return pd.read_parquet(file_name,**self.kwargs)++    def write_file(self,file_name):+        self.df.to_parquet(file_name, **self.kwargs)++class SQLSaver(DataFrameSaver):+    def __init__(self, df, name):+        raise NotImplementedError('sql details not setup')+        from sqlalchemy import create_engine+        super().__init__(df, name, file_format='sql')+        self.engine = create_engine('sqlite://', echo=False)+        self.kwargs = {'con':self.engine}++    def read_file(self,file_name):+        return pd.read_sql(file_name,**self.kwargs)++    def write_file(self,file_name):+        raise NotImplementedError('sql details not setup')+        engine = create_engine('sqlite://', echo=False)+        df.to_sql(file_name, index=False, **self.kwargs)++class FeatherSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='feather')+        self.kwargs = {}++    def read_file(self,file_name):+        return pd.read_feather(file_name,**self.kwargs)++    def write_file(self,file_name):+        self.df.to_feather(file_name, **self.kwargs)++class ExcelSaver(DataFrameSaver):+    def __init__(self, df, name):+        super().__init__(df, name, file_format='excel')+        self.kwargs = {}++    def read_file(self,file_name):+        return pd.read_excel(file_name,**self.kwargs)++    def write_file(self,file_name):+        self.df.to_excel(file_name, index=False, **self.kwargs)+++++def get_df_saver(df, name, file_format):+    +    if file_format=='json':+        df_saver = JSONSaver(df, name)++    elif file_format=='pickle':+        df_saver = PickleSaver(df, name)++    elif file_format=='csv':+        df_saver = CSVSaver(df, name)++    elif file_format=='hdf':+        df_saver = HDFSaver(df, name)++    elif file_format=='feather':+        df_saver = FeatherSaver(df, name)++    elif file_format=='sql':+        df_saver = SQLSaver(df, name)++    elif file_format=='parquet':+        df_saver = ParquetSaver(df, name)++    elif file_format=='excel':+        df_saver = ExcelSaver(df, name)

Write this as a dict instead:

formats = {'json': JSONSaver, 'pickle': PickleSaver, ...}
return formats[file_format]
joebe975

comment created time in 2 months

Pull request review commenterijo/sunnyportal-py

Add sunnyportal2file

 def parse(self, data):         self.power_measurements = []         tag_name = "fiveteen" if self.quarter else "hour"         for entry in tag.iterfind('./channel/day/%s' % tag_name):-            mean = self.kw_to_w(entry.get('mean'))-            if mean is not None:

Instead of always including all power measurements I added a parameter in 2986ad02 to only include it when requested.

joebe975

comment created time in 2 months

Pull request review commenterijo/sunnyportal-py

Add sunnyportal2file

 def __str__(self):   Yield = namedtuple('Yield', ['timestamp', 'absolute', 'difference'])-Power = namedtuple('Power', ['timestamp', 'power'])+Power = namedtuple('Power', ['timestamp', 'min_power','mean_power','max_power'])

I've merged these changes in a slightly different form (see 45bcd9d6). The power member is still there and the other two are called min and max.

Please rebase your changes ontop of this.

joebe975

comment created time in 2 months

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 45bcd9d633605ab92469e71402c6a8cad0da8649

Add support for min and max power in day overview See #9

view details

Erik Johansson

commit sha 2986ad02c952c00e6de854251db84f7d90013a7f

Add parameter to include all entries from day overview See #9

view details

push time in 2 months

push eventerijo/sunnyportal-py

Erik Johansson

commit sha 31479f67ca2ae52160d170d27ef531975c087fce

Add support for getting plant devices

view details

Erik Johansson

commit sha 6bfd33af2178e6d2bbc97a351be29d592f4080dc

Add support for getting device parameters

view details

Erik Johansson

commit sha 2383d214b79e5c80553d122b4eb373cd3f205593

Add initial support for getting energy balance Currently supports getting consumption/generation per month (for a year) or per day (for a month). This should also fix #1.

view details

push time in 2 months

pull request commenterijo/sunnyportal-py

Add sunnyportal2file

Just to let you know that I haven't forgot about this PR. I just haven't had time to look at it yet.

joebe975

comment created time in 2 months

issue commenterijo/sunnyportal-py

"Sunny Portal e-mail" error with cron

Run the script manually first to create the config file. Then use the same config file when you run the script from cron.

bstrin

comment created time in 2 months

issue commenterijo/sunnyportal-py

Problem when I call plant.profile()

Should be fixed now. Please try with latest master.

DOUADYtom

comment created time in 3 months

push eventerijo/sunnyportal-py

Erik Johansson

commit sha fa44fd76ba90c6faa2aac5e49997b4cc9cd53a0b

Handle profile response without any production-data tag Fixes #8

view details

push time in 3 months

issue closederijo/sunnyportal-py

Problem when I call plant.profile()

Hi, I just want to have the power_peak of all my plants and so I tried this:

for plant in client.get_plants(): plant.profile().peak_power client.logout()

and the result in the terminal is : Traceback (most recent call last): File "c:\Users\Desktop\Stage\python\test3.py", line 57, in <module> main() File "c:\Users\Desktop\Stage\python\test3.py", line 46, in main plant.profile().peak_power File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\client.py", line 77, in profile return self.client.do_request(req) File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\client.py", line 45, in do_request return request.perform(conn) File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\requests.py", line 82, in perform return self.handle_response(data) File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\requests.py", line 131, in handle_response return responses.PlantProfileResponse(data) File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\responses.py", line 53, in __init__ self.parse(data) File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sunnyportal\responses.py", line 155, in parse for channel in tag.find('production-data').findall('channel'): AttributeError: 'NoneType' object has no attribute 'findall'

I just don't understand why this error appears when I happen to have plant.name correctly and even plant.day_overview ().difference correctly too.

Thanks, Tom.

closed time in 3 months

DOUADYtom

issue commenterijo/sunnyportal-py

Problem when I call plant.profile()

But isn't there some more output before the error? There should be debug logs from the communication.

DOUADYtom

comment created time in 3 months

issue commenterijo/sunnyportal-py

Problem when I call plant.profile()

Could you please add the following to your test script, reproduce the error and post the output?

import logging
...
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.DEBUG)
DOUADYtom

comment created time in 3 months

more