aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/PGroup.py
diff options
context:
space:
mode:
authorGravatar Dave Grote <grote1@llnl.gov> 2017-12-04 13:48:07 -0800
committerGravatar Dave Grote <grote1@llnl.gov> 2017-12-04 13:48:07 -0800
commit7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7 (patch)
treeb8eb1571be62ccd8ee4aca34670e8549e6c4f8b1 /Python/pywarpx/PGroup.py
parent80d8c2eb76bb7996d119546a515515a4e803ad0b (diff)
downloadWarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.tar.gz
WarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.tar.zst
WarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.zip
Added len method to PGroup python class
Diffstat (limited to 'Python/pywarpx/PGroup.py')
-rw-r--r--Python/pywarpx/PGroup.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/pywarpx/PGroup.py b/Python/pywarpx/PGroup.py
index fa8572c0a..64e396d38 100644
--- a/Python/pywarpx/PGroup.py
+++ b/Python/pywarpx/PGroup.py
@@ -148,7 +148,7 @@ class PGroups(object):
self._pgroups = []
for igroup in range(self.ngroups):
self._pgroups.append(PGroup(igroup, self.ispecie))
-
+
def __iter__(self):
self.setuppgroups()
for igroup in range(self.ngroups):
@@ -158,3 +158,6 @@ class PGroups(object):
self.setuppgroups()
return self._pgroups[key]
+ def __len__(self):
+ self.setuppgroups()
+ return len(self._pgroups)
it@gmail.com> 2018-06-24Replace gh-release with curl (#1896)Gravatar Yong Tang 1-3/+10 * Replace gh-release with curl This fix tries to address the issue raised in 1895 where gh-release is deprecated. As GitHub provides API that could be accessed easily, and gh-release itself is just a wrapper to the API, this fix replaces gh-release with the direct interaction with GitHub API, so that it could be maintained by coredns team. This fix fixes 1895. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Added `-o /dev/null` Signed-off-by: Yong Tang <yong.tang.github@outlook.com> 2018-06-22retry creating dnstest.Server if tcp or udp port is in use (#1799)Gravatar Ruslan Drozhdzh 1-10/+20 * retry creating dnstest.Server if tcp or udp port is in use * changes according to review 2018-06-21plugin/template: fix CNAME upstream handling (#1886)Gravatar Chris O'Haver 4-4/+97 2018-06-21Makefile fixes: (#1892)Gravatar Miek Gieben 4-17/+12 Correctly set the path for the presubmits, fix some typos and make the goimport target do the linting to the lint target can be removed. Also don't make it a fatal error because gofmt changes between releases. 2018-06-21plugin/forward: Increase minimum read timeout to 200ms (#1889)Gravatar Tobias Schmidt 5-10/+10 After several experiments at SoundCloud we found that the current minimum read timeout of 10ms is too low. A single request against a slow/unavailable authoritative server can cause all TCP connections to get closed. We record a 50th percentile forward/proxy latency of <5ms, and a 99th percentile latency of 60ms. Using a minimum timeout of 200ms seems to be a fair trade-off between avoiding unnecessary high connection churn and reacting to upstream failures in a timely manner. This change also renames hcDuration to hcInterval to reflect its usage, and removes the duplicated timeout constant to make code comprehension easier. 2018-06-20Rename forward metrics socket_count_total to sockets_open (#1885)Gravatar Tobias Schmidt 1-1/+1 The prometheus naming convention states only counters should have a `_total` suffix, so that gagues and counters can be easily distinguished. 2018-06-20remove deprecated code (#1888)Gravatar Miek Gieben 3-4/+0 This removes: * reverse plugin from plugin.cfg * https_google option from proxy * the -log flag 2018-06-19Ensure cache.ResponseWriter can be used asynchronously during prefetch (#1884)Gravatar Tobias Schmidt 2-8/+40 The default dns.Response implementation of a dns.ResponseWriter will panic if RemoteAddr() is called after the connection to the client has been closed already. The current cache implementation doesn't create a new request+responsewriter during an asynchronous prefetch, but piggybacks on the request triggering the prefetch. This change copies the RemoteAddr first, so that it's safe to use it later during the actual prefetch request. A better implementation would be to completely decouple the prefetch request from the client triggering a request. 2018-06-19Release 1.1.4v1.1.4Gravatar Miek Gieben 3-4/+7 2018-06-18Follow up on #1867 : use one map in backend_lookup (#1869)Gravatar Miek Gieben 1-32/+33 Reduce map usage and combine two maps into one; add isDuplicate that tests and adds to make things more readable. 2018-06-18Plugin/Rewrite - review documentation of "append" (#1877)Gravatar Francois Tur 1-2/+2 * - ensure description of 'append' match what is encoded. * - fix description based on review comments 2018-06-15plugin/forward: add REFUSED test (#1878)Gravatar Miek Gieben 10-10/+62 add a test to see if we copy the rcode correctly. Some minor cleanup in import ordering and renaming NewUpstream to New as we already are in the upstream package. 2018-06-15Plugin/Forward - autotune the dialTimeout for connection (#1852)Gravatar Francois Tur 5-52/+84 * - implement an auto-tunable dialTimeout for fallback. * - fix gofmt * - factorized timeout computation with readTimeout / updated readme / * - fix comment 2018-06-13Run make -f Makefile.doc (#1875)Gravatar Miek Gieben 9-71/+50 Fix typo corendns -> coredns in coredns.1 2018-06-13Bump dns version to 1.0.8 (#1873)Gravatar Miek Gieben 1-1/+1 Bump the version, allows #691 to get merged. 2018-06-12plugin/file: fix local CNAME lookup (#1866)Gravatar Miek Gieben 5-28/+83 * plugin/file: fix local CNAME lookup Issue #1864 explains it will, when we serve the child zone as well we should just recursive into ourself (upstream self). Thus relax the IsSubDomain check in file/lookup.go and just query (even if the query will hit a remote server). I've looped over all other plugins that do something similar (CNAME resolving) and they didn't do the IsSubDomain check; therefor I've removed it from *file* as well. Added test in file_upstream_test that shows this failed before but now results in a reply. Fixes #1864 * self does not need to be exported * Fix test We don't know if we had a valid reply. Check this. 2018-06-11Remove dnsutil.Dedup (#1867)Gravatar Miek Gieben 6-61/+66 Remove the code and remove the call in etcd and kubernetes handlers. This does mean we should not add dups in the first place, which means adding maps in backend_lookup to prevent dups from begin added. This should cut down on the allocations because dnsutil.Dedup is very expensive by converting everything to strings, we avoid doing that now. 2018-06-07Update the pr template (#1862)Gravatar Miek Gieben 1-5/+1 Add "Why is this needed". I can get a description of what the PR does from the code changes, answering the why question is more important. 2018-06-07Normalizing Response Duration in Log Plugin (#1860)Gravatar Malcolm Akinje 2-1/+5 * Current stage of the log files. Test need to be done as well as formatting of times. * Finished testing. All altered classes test pass along with my additions * Updated the replacer package to print the units as well. May take out. * Changed the time units to be within the rules. Fixed the test as well. * Fixed some tests, updated the readme, fixed the replacer class. * Updates of standardizing only to seconds in response duration. Need to revert README. * Reverted readme. * Added a small test in new replacer. * Changed replacer to inline the strconv for duration. 2018-06-05plugin/forward: fix alignment for sync.Atomic (#1855)Gravatar Miek Gieben 1-3/+3 These must be alligned on 8 bytes, in Go this means putting them first in the struct (AFAICT). 2018-06-05Update Makefile.release for docker image build (#1856)Gravatar Yong Tang 1-15/+0 This fix update Makefile.release for docker image build on different platforms. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> 2018-06-04Docker: drop alpine (#1843)Gravatar Miek Gieben 1-3/+6 * Docker: drop alpine Create a multistage docker build image that uses debian to install certs and then create the final image by using FROM: scratch. This creates a (slightly) smaller images and drops busybox and alpine. * Even less copying 2018-06-02Fix presubmit (#1850)Gravatar Miek Gieben 2-15/+15 Uppercase these test cases as well. 2018-06-02presubmit: Check errorf as well (#1845)Gravatar Miek Gieben 19-52/+57 Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.