text:
(QA-2501) add ability to install hosts in parallel

Add :install_in_parallel option.  Default to false (existing behavior)
Run timesync in parallel if :install_in_parallel
Updated stop_agent_on to accept an array of hosts (as it was documented)
Updated sign_certificate_for to take an array of hosts (as it was documented)
install_puppet_on method now checks :install_in_parallel option
Added ability to run in parallel to run_block_on - closes host SSH connection in run_block_on after each parallel command is issued
Added run_in_parallel argument (defaulting to false) to:

run_block_on
block_on
on
install_puppet_agent_on
apply_manifest_on
stop_agent_on
execute_powershell_script_on

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2535/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2537/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2538/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2540/

@puppetlabs-jenkins retest this please

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2548/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2547/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2549/

@samwoods1 this PR needs acceptance tests; let's remove that label after they have been submitted for this work.

@samwoods1 Nice job, I like these changes.  Overall, I think we should pursue keeping this as an options in the various opts parameters, and we definitely need acceptance tests.  I'm happy to help with either!

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2558/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2562/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2563/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2564/

Much of the acceptance testing will be performed by this: https://jenkins-beaker.delivery.puppetlabs.net/job/In parallel job (In progress)/ which will execute some basic validation after running a parallel install for the following configurations: pe, pe with frictionless agent, FOSS. This will run on a matrix of agent OS's.  I'm looking at possibly doing some upgrade tests as well.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2565/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2567/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2566/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2568/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2569/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2590/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2615/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2617/

@samwoods1, we were discussing the potential timing of merging & releasing this change earlier today, and were thinking of potentially giving it its own Y release, in order to minimize risk. This would be a follow-on to the June 29th currently planned release.
One thing that would be helpful from both a minimizing risk standpoint and a "getting your changes out faster" standpoint would be if you separated out the unrelated bugfixes from the parallel work. Then we could merge those into the next release, and make this as small as possible for it's own release. Is this something that you have time for?

@samwoods1 to summarize our discussion yesterday:

Alter/make configurable the behavior of in-parallel to wait for all forks to finish before raising exceptions; I think the default should be to fail "slow", so all forks have a chance to complete.

Add a default timeout for child process completion; this is just a failsafe so that something doesn't hang forever. I'm guessing that 30 min is a decent default to start with? I'm also assuming that this is something outside of the code in this PR...I'd love to take a look at that code when it's ready.

Solving the "in-parallel" level setting. We had talked about a none, conservative, and aggressive settings. I'm still unsure of what the best solution might be...

Overall, my ad hoc testing of this has been pretty good. I'm excited to merge in the functionality.

@kevpl  the only bug fixes I did were things that were required to do this work.  Was there particular stuff you wanted to see in a separate PR?

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2624/

Ok... I believe I have addressed all of the feedback up to this point.
@tvpartytonight

I updated in-parallel to wait for all forked processes to complete before re-raising an exception from the child process by default (and optionally fail fast)
Added default timeout https://github.com/puppetlabs/in-parallel/pull/6
Changed install_in_parallel to run_in_parallel with array of values.  Currently only supports 'configure' and 'install'

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2632/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2634/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2647/

retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2654/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2655/

retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2665/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2666/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2668/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2669/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2670/

I made some minor updates to the in-parallel library to address some of the things Tony mentioned to me, mainly the logging.  Now it is using a logger, and will swap out it's own simple logger with the Beaker logger if it is available.  I also consolidated a lot of the logging so there are fewer unique log messages.
I Also made a couple of bug fixes, one to address the timeouts we were seeing on Fedora and Ubuntu tests, and one to fix an issue where pressing CTRL-C or stopping a debugging session would always kill the child proc's, but wouldn't abort execution of the program, you always had to do it a second time to truly stop.  I think how things are should be pretty stable now.

@samwoods1 so in ESO Codecraft today I mentioned the fact that (at least for *nix-like systems) when forking a new subprocess each new subprocess will inherit a COW clone of all the parent process's memory segments as well as copies of the parent process' file descriptors. From that point on, any changes made in the child process will not be reflected in the parent process' memory space, ie changes made to variables defined outside the parellelized block.
I understand that you have provided for interprocess communication by allowing forked processes to return values to the parent process but given the proclivity of ruby programmers to modify non-local state it should be made more clear than it currently is that what happens in the child process stays in the child process (unless explicitly returned--but of course, that part you have already documented).

@waynr Good point, I updated documentation in run_in_parallel.md to include this info.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2681/

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2698/

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/2699/

LGTM!

authors: kevpl nwolfe pinkypie puppetlabs-jenkins samwoods1 tvpartytonight waynr

repo: puppetlabs/beaker


text:
Feature-request: Preview / read-only run mode for Tasks and Tasks Plans

As a user of bolt, I would really like the ability to be able to "preview" a run without actually executing the specified script. This process would validate that my node list is valid, all of the specified hostnames / IPs resolve as expected, connections ((PXP or ssh) to these nodes are successful, that script file(s) can be transferred successfully, etc. It would also output the specific hostname and IP resolved to help me troubleshoot issues with DNS / etc/hosts discrepancies.
The output would return information about each stage of the process (connections successful, script file(s) transferred, etc.) but instead of running the actual script, it just runs a dummy command (e.g. echo to STDOUT) in place of the actual script. There's been several occasions where I've wanted to test a very specific set of command parameters to bolt against specific servers and pre-validate everything before running but the actual script I'm trying to run is not idempotent, so I can only run it once. (I realize I could just create a dummy script to accomplish this same goal but I think having a flag where you can turn this on and off would be a nice feature)
Additionally, having something similar for Task plans where it provides a "noop" / "readonly" ability would greatly improve the usability of Bolt for me.
Thanks!
Joel

For tasks that support "noop" you should already be able to do this.

Related: We have plans to add a 'noop' mode for plans. https://tickets.puppetlabs.com/browse/BOLT-273 @jdub55 unless there are other actions items, going to close this issue for now.

source: gharchive/issue

authors: adreyer jdub55 lucywyman

repo: puppetlabs/bolt

license_type: permissive

license_source: github-api


text:
(BOLT-380) Make Bolt compatible with net-ssh 4 and 5

We plan to package Bolt with net-ssh 5, primarily for ed25519 support.
However many things that might be used alongside bolt-as-a-gem - such as
Beaker - still pin to net-ssh 4. Make it compatible with both.

Yeah, that should always be true. I'm not sure I want to add a test matrix that shows it still works with net-ssh 4...

:+1: when rubocop is.

source: gharchive/pull-request

authors: MikaelSmith donoghuc


text:
(FACT-1164) Fix acceptance, take 2

Prior fix to acceptance used assert_equal rather than assert_match, and
an incorrect regex string. Fix both issues.

Acceptance validation:
Begin tests/ticket_1164_win32ole_custom_fact.rb

Custom facts should not hang Facter when using win32ole

f3vx5ysdzg3gllm.delivery.puppetlabs.net (agent-2012r2-x86_64-rubyx64) 14:24:53$ cygpath -m $(mktemp -td arbitrary_dir.XXXXXX)
C:/cygwin64/tmp/arbitrary_dir.aTqt1y

f3vx5ysdzg3gllm.delivery.puppetlabs.net (agent-2012r2-x86_64-rubyx64) executed in 0.13 seconds
localhost $ scp /var/folders/gr/lnzxwt5j0736c6rwk6yjq92h0000gn/T/beaker20150825-49674-1k9ezi0 agent-2012r2-x86_64-rubyx64:C:/cygwin64/tmp/arbitrary_dir.aTqt1y/custom_fact.rb {:ignore => }

f3vx5ysdzg3gllm.delivery.puppetlabs.net (agent-2012r2-x86_64-rubyx64) 14:24:53$ cmd.exe /c facter --custom-dir C:/cygwin64/tmp/arbitrary_d  1 (FACT-1164) Fix acceptance, take 2
ir.aTqt1y custom_fact
#<WIN32OLE:0x0000000163d2c8>

f3vx5ysdzg3gllm.delivery.puppetlabs.net (agent-2012r2-x86_64-rubyx64) executed in 1.05 seconds
tests/ticket_1164_win32ole_custom_fact.rb passed in 1.41 seconds
      Test Suite: tests @ 2015-08-25 14:24:53 -0700

      - Host Configuration Summary -

              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1.41 seconds
      Average Test Time: 1.41 seconds
  1 (FACT-1164) Fix acceptance, take 2
              Attempted: 1
                 Passed: 1
                 Failed: 0
                Errored: 0
                Skipped: 0
                Pending: 0
                  Total: 1

      - Specific Test Case Status -

Failed Tests Cases:
Errored Tests Cases:
Skipped Tests Cases:
Pending Tests Cases:

No tests to run for suite 'post_suite'
Cleanup: cleaning up after successful run
Warning: ssh connection to agent-2012r2-x86_64-rubyx64 has been terminated
Handing 'f3vx5ysdzg3gllm.delivery.puppetlabs.net' back to vmpooler for VM destruction
Spent 0.43 seconds cleaning up

repo: puppetlabs/facter

license_source: bigquery


text:
Reference docs are often wrong

Describe the Bug
For "reasons" our configuration refererence docs are often incorrect, especially when a setting's default value is different between 7.x and 8.x. For example, the default value of strict_variables is correct in 7.x, but wrong in 8.x.
Expected Behavior
The reference documentation should be accurate for each branch.
I would like to see the configuration reference pages generated in CI and checked into the repo, similar to how we handle man pages. That way the list of settings and default values are guaranteed to be accurate for each branch.
This is mostly an issue with the configuration reference, but also includes other documentation like the type & provider docs, which providers support which features, etc. Other changes may be required to puppet-strings for that. See PDOC-262
Additional Context
https://perforce.atlassian.net/browse/PUPDOC-5594
https://perforce.atlassian.net/browse/PUPDOC-5591
https://perforce.atlassian.net/browse/PUPDOC-5562
https://perforce.atlassian.net/browse/PUPDOC-5491
https://perforce.atlassian.net/browse/PUPDOC-5481
https://github.com/puppetlabs/puppet-docs/issues/1166

Fixed in https://github.com/puppetlabs/puppet/pull/9459 https://github.com/puppetlabs/puppet/pull/9462 https://github.com/puppetlabs/puppet/pull/9463 https://github.com/puppetlabs/puppet/pull/9464 https://github.com/puppetlabs/puppet/pull/9465 https://github.com/puppetlabs/puppet/pull/9466

repo: puppetlabs/puppet


text:
(PUP-8436) Exclude *.pot files only during locales sync

Previously, *.pot files were excluded from all pluginsync related mounts
(plugins, pluginfacts, locales). Since fact files can be named anything,
and only need to be executable, this could have prevented a necessary
fact from being downloaded to an agent.
Move the *.pot exclusion so it only affects the 'locales' mount.

On the master:
$ find /etc/puppetlabs/code/environments/production/modules/ -type f -name "*.pot"
/etc/puppetlabs/code/environments/production/modules/stdlib/locales/puppetlabs-stdlib.pot
/etc/puppetlabs/code/environments/production/modules/apache/locales/puppetlabs-apache.pot

On the agent:
$ find ~/.puppetlabs/opt/puppet/cache/locales
/Users/josh/.puppetlabs/opt/puppet/cache/locales
/Users/josh/.puppetlabs/opt/puppet/cache/locales/ja
/Users/josh/.puppetlabs/opt/puppet/cache/locales/ja/puppetlabs-apache.po
/Users/josh/.puppetlabs/opt/puppet/cache/locales/ja/puppetlabs-pe_manager.po
/Users/josh/.puppetlabs/opt/puppet/cache/locales/ja/puppetlabs-stdlib.po

Note *.pot is URL encoded below:
<- "GET /puppet/v3/file_metadatas/pluginfacts?environment=production&links=follow&recurse=true&source_permissions=use&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1\r\nAccept: application/json, application/x-msgpack, text/pson\r\nX-Puppet-Version: 5.3.5\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Puppet/5.3.5 Ruby/2.1.9-p490 (x86_64-darwin15.0)\r\nHost: x1ajtt51b1e9dw5.delivery.puppetlabs.net:8140\r\n\r\n"
...
<- "GET /puppet/v3/file_metadatas/plugins?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1\r\nAccept: application/json, application/x-msgpack, text/pson\r\nX-Puppet-Version: 5.3.5\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Puppet/5.3.5 Ruby/2.1.9-p490 (x86_64-darwin15.0)\r\nHost: x1ajtt51b1e9dw5.delivery.puppetlabs.net:8140\r\n\r\n"
...
<- "GET /puppet/v3/file_metadatas/locales?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&ignore=%2A.pot&ignore=config.yaml&checksum_type=md5 HTTP/1.1\r\nAccept: application/json, application/x-msgpack, text/pson\r\nX-Puppet-Version: 5.3.5\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Puppet/5.3.5 Ruby/2.1.9-p490 (x86_64-darwin15.0)\r\nHost: x1ajtt51b1e9dw5.delivery.puppetlabs.net:8140\r\n\r\n"

CLA signed by all contributors.

authors: joshcooper puppetcla


text:
(maint) Account for new OpenSSL 1.1.1 behavior

OpenSSL 1.1.1 now enforces a minimum of 512 bit RSA keys and it performs a noop if the same cert is added to an X509 store. This PR updates the tests accordingly.
Note we're currently only testing openssl 1.1.1 in the puppet 6.0.x branch with ruby 2.5 on appveyor, but it seems like a good thing to fix in 5.5.x.

CLA signed by all contributors.


text:
(IAC-1127) search for facter.exe on Windows platforms

Before this change, the facts task would assume that if #{rubydir}/facter exists, this should be the executable for facter.
On Puppet Agent 6 this file exists and is the entry point for linux. The entry point for windows on Puppet 6 that ships with cFacter is  #{rubydir}/facter.exe .
Open 3 knows how to execute files on Windows without explicitly specifying the extensions, eg:
irb(main):006:0> stdout, stderr, status = Open3.capture3("C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\ruby.exe", "-v")

irb(main):007:0> stdout, stderr, status = Open3.capture3("C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\ruby", "-v")

On Puppet Agent 7, we ship Facter 4 that is written in ruby, so facter.exe executable no longer exists. Because of this:
C:\Program Files\Puppet Labs\Puppet\puppet\bin\facter exists as the Ruby entrypoint for facter, but C:\Program Files\Puppet Labs\Puppet\puppet\bin\facter.exe no longer exists causing the facts task to fail on Windows.
The changes from this PR should work on Puppet Agent 6 (with cFacter) and Puppet Agent 7 (with Ruby Facter)

Should this check that the facter.exe path exists, and if not try to use the "old" path instead of just falling back to "facter"? So like:
def facter_executable
    exe_path = "\"#{File.join(File.dirname(RbConfig.ruby), 'facter.exe')}\""
    ruby_path = File.join(File.dirname(RbConfig.ruby), 'facter')
    if Gem.win_platform? && File.exist?(exe_path)
      exe_path
    elsif File.exist?(ruby_path)
      ruby_path
    else
      'facter'
    end
end

@lucywyman  good catch. I didn't take into consideration the case when facter was installed as a gem to a Ruby that is not part of Puppet Agent. I've updated the code and tested the following scenarios:

Case 1 - Using system Ruby

=> :facter_executable
irb(main):019:0> facter_executable
=> "\"C:/Ruby26-x64/bin/facter.bat\""
irb(main):020:0> require 'open3'
=> true
irb(main):021:0> stdout, stderr, status = Open3.capture3("#{facter_executable} -v")
=> ["4.0.37\n", "", #<Process::Status: pid 6864 exit 0>]

Case 2 - Ruby from Puppet Agent 6

irb(main):040:0> facter_executable
=> "\"C:/Program Files/Puppet Labs/Puppet/puppet/bin/facter.exe\""
irb(main):041:0> require 'open3'
=> true
irb(main):042:0> stdout, stderr, status = Open3.capture3("#{facter_executable} -v")
=> ["3.14.13 (commit fd44acffcc64544da913e49acfa02bf0da7be62c)\n", "", #<Process::Status: pid 2072 exit 0>]

Case 3 - Ruby from Puppet Agent 7

=> :facter_executable
irb(main):019:0> facter_executable
=> "facter"
irb(main):020:0> require 'open3'
=> true
irb(main):021:0>  stdout, stderr, status = Open3.capture3("#{facter_executable} -v")
irb(main):022:0> stdout
=> "4.0.37\n"

Please note that ruby_path only works on Windows because Ruby makes assumptions on the extensions of an executable file: https://github.com/ruby/ruby/blob/ruby_2_7/win32/win32.c#L5545-L5549
So, a file can exist but not necessarily be executable.

authors: lucywyman mihaibuzgau

repo: puppetlabs/puppetlabs-facts


text:
(QENG-5106) Add public key for always-be-scheduling

We need to add the public key for ABS to the authorized_keys file to allow puppet to connect to new EC2 instances allocated by ABS.

👍

authors: mchllweeks tvpartytonight

repo: puppetlabs/puppetlabs-sshkeys


text:
[NLU-4110] - Arabic (eastern) digits not resolved

Fix for Arabic Eastern digits (١, ٢, ٣, ٤, ٥, ٦, ٧, ٨, ٩, ٠) not resolving correctly.
Issue wasn't with digits themselves, more so with the way they were being written. Special arabic separators are used in order to distinguish decimals and thousands as below

٬ - Arabic thousand separator
٫ - Arabic decimal separator

These entries were not present in regex files, causing the following examples to fail:

١٬٠٠٠٫٠٥ - 1,000.05
۴۵۳٬۲۸۰٬۷۱۶ - 453,280,716

Give the regression tests a run against this running locally if you like

repo: purecloudlabs/Recognizers-Text

license: MIT


text:
Avoid using execSync or execFileSync

As options we can:

use the existing executeProcess helper under utils or
implement a new helper based on execFile & promisify

@getlarge I added this one based on our yesterdays chat. If I miss something feel free to directly change the issue.


text:
currentUser.createRoom() addUserIds does not fire the addedToRoom event

When creating a new chat room and adding user_2 to it using the addUserIds method the addedToRoom event doesn't fire in user_2's websocket.
currentUser.createRoom(
    {
        name: "aol_chat_room",
        addUserIds: ['user_2']
    },
    function (room) {},
    function (error) {}
);

In order to get it to fire you'd need to add the user to the chat room after the room is created in the success callback like so.
currentUser.createRoom(
    {
        name: "aol_chat_room",
    },
    function (room) {
        Laravel.chatkit.currentUser.addUser(
            'user_2',
            room.id,
            function (room) {},
            function (error) {}
        );
    },
    function (error) {}
);

I would expect that regardless of how someone is added to a room, either at creation or moments after, both would fire the addedToRoom event.

That sounds like a bug as the behaviour you've described is how it should be working. I'll take a look at what's going on and get back to you.

Just to keep you updated, I tested this and it doesn't seem to be an issue with this SDK but in fact with the service itself. We'll should have a fix for it tomorrow if all goes well!
Thanks for the report. I'll update this when it's fixed.

@hamchapman I suspected it was with the backend service but didn't know if there was a better place to report it. Thanks for the update.

@gileswells I've just created a PR for our server side and is up for review tomorrow morning when we're all back at work. We'll ping you when its all merged in and good to go!

@gileswells We've just pushed out a fix and tested with the JS SDK. Hopefully it should all be working as expected. Thanks for reporting this issue.

I see it working on my end as well. Thanks for the quick fix @vivangkumar!

authors: gileswells hamchapman vivangkumar

repo: pusher/chatkit-client-js


text:
Add Users support

Adding Users support, currently missing the Publish to users support.

Pending public feature release

authors: luismfonseca minaorangina

repo: pusher/push-notifications-go


text:
setEnterpriseConfig

there is no method in react-native to set enterprise configuration, Is there any possibility to get near in future or not?

Hi @ShahirZain,
Thanks for creating this issue.
The method Pushy.setEnterpriseConfig() is definitely supported by the Pushy React Native SDK (for both iOS & Android). It needs to be invoked from within React Native as follows:
Pushy.setEnterpriseConfig("https://ENTERPRISE_HOSTNAME", "ssl://ENTERPRISE_HOSTNAME");

Note: Please replace ENTERPRISE_HOSTNAME with your Pushy Enterprise deployment hostname. Please get in touch with us if you have any further questions, via e-mail at support@pushy.me.

authors: ShahirZain pushy

repo: pushy/pushy-react-native


text:
🛑 SIAKAD is down

In f8d79b0, SIAKAD (https://siakad.unmer.ac.id/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SIAKAD is back up in c7aac5b.

repo: pusimgit/upptime


text:
Fine-tune workout mappings.

Fitocracy workout name = Sports Tracker workout comment
Fitocracy workout exercise note = Sports tracker workout url (this mapping can be used to determine which workouts have been synced already)

Implemented in 72df996e9990f8c7efa9f8bee6bfd50c72a7629c

repo: putsi/SportSync

license: mit


text:
Add Compute method to Map

A follow-up of #68

Codecov Report
Base: 96.80% // Head: 97.03% // Increases project coverage by +0.22% :tada:

Coverage data is based on head (5e00787) compared to base (f7778ac).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   96.80%   97.03%   +0.22%
==========================================
  Files           6        6
  Lines         909      912       +3
==========================================
+ Hits          880      885       +5
+ Misses         24       22       -2
  Partials        5        5

Impacted Files
Coverage Δ

map.go
97.01% <100.00%> (+0.22%)
:arrow_up:

mapof.go
96.38% <100.00%> (+0.33%)
:arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

authors: codecov-commenter puzpuzpuz

repo: puzpuzpuz/xsync


text:
Reverse ghi from ipoa

Like Bill Marion's paper, only better

Are these just teasers??

You mean the GTI-DIRINT paper? http://dx.doi.org/10.1016/j.solener.2015.10.024

I emailed two papers to Will H. I will try to implement the gti-dirint, but probably not until q2

authors: adriesse mikofski wholmgren

repo: pvlib/pvlib-python


text:
🛑 NARLabs is down

In 5de6933, NARLabs (https://www.narlabs.org.tw/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: NARLabs is back up in 6a6d4bf.

repo: pwtsai/upptime


text:
Freeze Causal Mechanism for a Node?

This question is in the context of detecting distribution change. Suppose we have a graph like: Y->X, Z->X. Can the causal mechanism for X be frozen? That means we want to rule out the possibility of distribution change on X and only allow distribution change occurs on Y or Z.

@bloebp Yes, this will be very helpful. Look forward to see the code change!

Hey, a bit delayed, but we finally have this feature implemented: https://github.com/py-why/dowhy/commit/b4f80dcb2251a03aff4c816d7c6f6eb2aaf98e73
It now has a invariant_nodes parameter to indicate this.

authors: bloebp htcml

repo: py-why/dowhy


text:
GSQL Doesn't Work with HTTPS boxes

Describe the bug
We want to produce secrets using pyTigerGraph. Currently, the package strips http:// and https:// information, leading the connection to not work.
To Reproduce
This is the offending line in the gsqlInit() function:
self.url = self.gsUrl.replace("https://", "").replace("http://", "")  # Getting URL with gsql port w/o https://
Expected behavior
Do not strip http:// and https:// from url in order to work with ssl secured connections.

this issue is solved in  v0.0.9.6.7

authors: parkererickson zrougamed

repo: pyTigerGraph/pyTigerGraph


text:
Developer log should redact access point password info

Currently, the user-specified access point authentication password is exposed in the developer log:
[D] Network info update accepted: GRP=Connected(ssid=DIRECT-TF-brlin, password=0123456789) CON=Connected(hostName=192.168.49.1)

As such information may be used in a Credential stuffing attack we probably should redact it by default.
Additional information
TetherFi
49 from Google Play
Android
14 (AP2A.240905.003)
Phone
Google Pixel 8 Pro

Addressed in this commit: 9c4b42250a4a7e0b9b260b666ae658dd0eec44d0
Most likely for release 50
Thank you!

authors: brlin-tw pyamsoft

repo: pyamsoft/tetherfi


text:
ServerInfo file empty, pyfluent slurm job

the pyfluent script is sent through SLURM job scheduler.
It fails because the serverinfo file is empty (the file exists), cf. below slurm job output.
Can you help me understand why this file is empty.
Note: the pyfluent script works outside from the scheduler (on the same cluster).
Traceback (most recent call last):
File "/pyfluent.py", line 11, in
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None )
File "/home/.local/lib/python3.9/site-packages/ansys/fluent/core/launcher/launcher.py", line 419, in launch_fluent
return new_session.create_from_server_info_file(
File "/home/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 97, in create_from_server_info_file
ip, port, password = parse_server_info_file(server_info_filepath)
File "/home/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 28, in parse_server_info_file
ip_and_port = lines[0].strip().split(":")
IndexError: list index out of range
Failed to connect to bus: Connexion refusée

Can you share the sbatch command and the script you used for submission to SLURM?

Hello Dan, the script and the batch are attached.
Thank you for your help.
De : Dan Williams @.>
Envoyé : Wednesday, April 26, 2023 3:29 AM
À : pyansys/pyfluent @.>
Cc : Clara Picoron @.>; Author @.>
Objet : Re: [pyansys/pyfluent] ServerInfo file empty, pyfluent slurm job (Issue #1548)
[External Sender]
Can you share the sbatch command and the script you used for submission to SLURM?
—
Reply to this email directly, view it on GitHubhttps://github.com/pyansys/pyfluent/issues/1548#issuecomment-1522633036, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6WD5PIVVXVMNJ7K6RBY7ELXDB27BANCNFSM6AAAAAAXCSR4TQ.
You are receiving this because you authored the thread.Message ID: @.@.>>

You will need to paste it into a reply :-)

This is the sbatch script:
`#!/bin/bash
###############################################################
###############################################################
#BEGINNING OF USER SECTION
###############################################################
###############################################################

Batch options for SLURM (Simple Linux Utility for Resource Management)
=======================

Parametre utilisateur :
- specifier le nombre de serveurs de calcul a utiliser (--nodes=  )
- [option] : specifier le nom sous lequel le job va apparaitre dans le gestionnaire de queue (--job-name=  )
- specifier la version de FLUENT a utiliser (VERSION=  )

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=0-00:30:00
#SBATCH --partition=cn
#SBATCH --enable-turbo
#SBATCH --wckey=DTIPD:CFD
#SBATCH --job-name=PYFLUENT
###############################################################
###############################################################
#REMPLISSAGE BDD TEMPS D'ATTENTE
###############################################################
###############################################################
user_id=whoami
fullname=getent passwd "$user_id" | cut -d: -f5 | cut -d, -f1
job_duration=sacct -n -X -j $SLURM_JOBID --format="Elapsed"
job_date_submission=sacct -n -X -j $SLURM_JOBID -o Eligible
job_date_start=sacct -n -X -j $SLURM_JOBID -o Start
job_walltime=sacct -n -X -j $SLURM_JOBID -o Timelimit
Convert date to seconds
a=date --date $job_date_start +%s
b=date --date $job_date_submission +%s
job_start_delay=$((a - b))
Convert HH:MM:SS to seconds
c=echo $job_walltime | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }'
job_start_delay_percent=$((100*$job_start_delay/$c))
Write some info to file "Database_Jobs_WaitingTime.dat"
echo "$SLURM_JOBID ; $user_id ;$job_duration;$job_walltime; $job_start_delay ; $job_start_delay_percent" >> /path1/SLURM/Database_Jobs_WaitingTime.dat
#-------------------------------------------------------------------------------
NOM DU FICHIER JOURNAL DU CALCUL FLUENT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INPUT_FLUENT=Launch_fluent_steady.jou
VERSION="22.2"
DIMENSION="3D"    # Specifier 2D ou 3D
MARGE_SECURITE=1800    # Arret du calcul avec enregistrement xxx secondes avant le Wall Time
AUTO_RESTART="False"    # True ou False : redémarrage automatique du calcul si celui-ci est arrêté à l'approche du Wall Time
module load ansys/$VERSION
module load anaconda/3.9
###############################################################
###############################################################
#END OF USER SECTION
###############################################################
###############################################################
Liste des variables d'environnement SLURM
echo "SLURM_JOB_NODELIST=$SLURM_JOB_NODELIST"
echo "SLURM_NNODES=$SLURM_NNODES SLURM_TASKS_PER_NODE=$SLURM_TASKS_PER_NODE"
env | grep -e MPI -e SLURM
NBCPU=$SLURM_NPROCS
Repertoire courant
WORKDIR=pwd
MYINPUT_FLUENT=$INPUT_FLUENT
Liste des machines
MACHINEFILE="machinefile.$SLURM_JOBID.txt"
srun /bin/hostname -s | sort -u > $WORKDIR/$MACHINEFILE
srun hostname > ./FRB.$SLURM_JOB_ID
#export OMP_NUM_THREADS=1
Change to submission directory
if test -n "$SLURM_SUBMIT_DIR" ; then cd $SLURM_SUBMIT_DIR ; fi
Recuperation du nom du fichier de sortie
CASENAME=output_fluent
OUTPUT_NAME="${CASENAME%.*}.o$SLURM_JOBID"
NBCPU=$SLURM_NPROCS
HOSTFILE=hosts.$SLURM_JOBID
srun /bin/hostname > $HOSTFILE
MONPNPNODES=awk '{for (i=1; i<=NF; i++)mot[$i]++} END {for (i in mot) {printf"%s,%s ",i,mot[i]}}' $HOSTFILE | sort -n -r
rm -rf $HOSTFILE
USERSDIR="$BRIDGE_MSUB_PWD/ufile"
MYJOB=$SLURM_JOBID
SAFETY_STOP="safety_stop.$SLURM_JOBID"
echo "OUTPUT_NAME: "$OUTPUT_NAME
Chargement du MPI
OPT_MPI="-mpi=intel"
###############################
###############################
Gestion des licences (HPC anshpc / jetons calcul acfd_2)
Recuperation du nombre de licences "acfd_2" disponibles
NB_DISPO_1=/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of cfd_solve_level1:" | awk '{print $6-$11}'
echo "1 jeton licence cfd_solve_level1 demande, $NB_DISPO_1 jeton(s) licence cfd_solve_level1 disponibles"
Recuperation du nombre de licences "anshpc" disponibles
NB_DISPO_2=/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of anshpc:" | awk '{print $6-$11}'
echo $NB_DISPO_2
Recuperation du nombre de licences "anshpc_pack" disponibles
NB_DISPO_pack=/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of anshpc_pack:" | awk '{print $6-$11}'
if [ -z $NB_DISPO_pack] || [ $NB_DISPO_pack -lt 1] ; then
NB_DISPO_3=0
else
if [ $NB_DISPO_pack -lt 2 ] ; then
NB_DISPO_3=12
else
if [ $NB_DISPO_pack -lt 3 ] ; then
NB_DISPO_3=36
else
if [ $NB_DISPO_pack -lt 4 ] ; then
NB_DISPO_3=132
else
if [ $NB_DISPO_pack -lt 5 ] ; then
NB_DISPO_3=516
else
if [ $NB_DISPO_pack -lt 6 ] ; then
NB_DISPO_3=2052
else
if [ $NB_DISPO_pack -lt 7 ] ; then
NB_DISPO_3=8196
else
if [ $NB_DISPO_pack -lt 8 ] ; then
NB_DISPO_3=32772
else
if [ $NB_DISPO_pack -lt 9 ] ; then
NB_DISPO_3=131076
else
if [ $NB_DISPO_pack -lt 10 ] ; then
NB_DISPO_3=524292
else
if [ $NB_DISPO_pack -lt 11 ] ; then
NB_DISPO_3=2097156
else
if [ $NB_DISPO_pack -lt 12 ] ; then
NB_DISPO_3=8388612
else
NB_DISPO_3=33554436
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
NB_DISPO_hpc=$(($NB_DISPO_2 + $NB_DISPO_3))
Evaluation du besoin en licences HPC ("anshpc" et "anshpc_pack")
if [ $SLURM_NTASKS -lt 4 ] ; then
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
echo "   >> De 1 a 4 processeurs demandes :"                          >> $OUTPUT_NAME
echo "   >> Le calcul ne prendra pas de licences HPC..."          >> $OUTPUT_NAME
echo "   >> Seul un jeton cfd_solve_level1 suffit..."               >> $OUTPUT_NAME
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
NB_NEED=0
else
NB_NEED=$(( $SLURM_NTASKS - 4 ))
fi
echo "$NB_NEED HPC licences demandee, $NB_DISPO_hpc HPC licences disponibles" >> $OUTPUT_NAME
if [ $NB_DISPO_1 -eq 0 ] ; then # Cas ou il manque des jetons de calcul
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
echo "   >> Il n'y a plus de licences cfd_solve_level1 disponibles...">> $OUTPUT_NAME
echo "   >> Le calcul ne peut pas etre lance..."                >> $OUTPUT_NAME
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
launchFLUENT="NotOK"
echo "      Le calcul va etre remis en queue" >> $OUTPUT_NAME
FILE_REQ_COUNT="REQ_COUNT_$SLURM_JOBID"
if [ -f $FILE_REQ_COUNT ] ; then
cm=cat $FILE_REQ_COUNT
cm=$(( $cm + 1 ))
echo "      C'est la $cm eme tentative" >> $OUTPUT_NAME
else
cm=1
echo "      C'est la 1ere tentative" >> $OUTPUT_NAME
fi
echo $cm > $FILE_REQ_COUNT
scontrol requeue $SLURM_JOBID
sleep 240 # Le serveur peut mettre un peu de temps a rendre le requeue effectif
# et a arreter le script en general on n attend pas les 4 minutes
else
if [ $NB_NEED -ne 0 ] && [ $NB_NEED -gt $NB_DISPO_hpc ] ; then # Cas ou il manque des licences HPC
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
echo "   >> Pas assez de licence HPC disponibles"               >> $OUTPUT_NAME
echo "   >> Le calcul ne peut pas etre lance..."                >> $OUTPUT_NAME
echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
launchFLUENT="NotOK"
echo "    Le calcul va etre remis en queue" >> $OUTPUT_NAME
FILE_REQ_COUNT="REQ_COUNT_$SLURM_JOBID"
if [ -f $FILE_REQ_COUNT ] ; then
cm=cat $FILE_REQ_COUNT
cm=$(( $cm + 1 ))
echo " C'est la $cm eme tentative" >> $OUTPUT_NAME
else
cm=1
echo " C'est la 1ere tentative" >> $OUTPUT_NAME
fi
echo $cm > $FILE_REQ_COUNT
scontrol requeue $SLURM_JOBID
sleep 240 # Le serveur peut mettre un peu de temps a rendre le requeue effectif
# et a arreter le script en general on n attend pas les 4 minutes
else # Cas ou tout est disponible
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<"         >> $OUTPUT_NAME
    echo "   >> Le calcul a trouve un jeton licence cfd_solve_level1 disponible"  >> $OUTPUT_NAME
    echo "   >> ainsi que le nombre de licences HPC demande"                      >> $OUTPUT_NAME
    echo "   >> Le calcul peut etre lance..."                             >> $OUTPUT_NAME
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<"         >> $OUTPUT_NAME
    launchFLUENT="OK"
fi

fi
###############################
###############################
Dimension du probleme
if [ $DIMENSION = "2D" ] ; then
OPT_DIM="2ddp"
fi
if [ $DIMENSION = "3D" ] ; then
OPT_DIM="3ddp"
fi
Marge de securite pour sauvegarde avant atteinte du Wall Time
echo "SLURM_JOBID=$SLURM_JOBID" >> $OUTPUT_NAME
PTIME=sacct -j $SLURM_JOBID -o Timelimit -X --noheader
echo "PTIME=###"$PTIME"###" >> $OUTPUT_NAME
echo "len(PTIME)="echo $PTIME | wc -c >> $OUTPUT_NAME
while [ echo $PTIME | wc -c -lt 5 ] ; do
echo "Tentative de recuperation du Wall Time..." >> $OUTPUT_NAME
sleep 1
PTIME=sacct -j $SLURM_JOBID -o Timelimit -X --noheader
echo $PTIME >> $OUTPUT_NAME
done
DD=0
RESTE=$PTIME
if [ echo $PTIME | grep "-" | wc -l = 1 ] ; then
DD=echo $PTIME | cut -d "-" -f1
RESTE=echo $PTIME | cut -d "-" -f2
fi
timeLimit=echo $RESTE | awk 'BEGIN{FS=":"}{print DD*86400+$1*3600+$2*60+$3-MARGE_SECURITE}' DD=$DD MARGE_SECURITE=$MARGE_SECURITE
echo "WallTime = $PTIME" >> $OUTPUT_NAME
echo "timeLimit = $timeLimit s" >> $OUTPUT_NAME
( sleep $timeLimit ; stop_fluent $OUTPUT_NAME ; touch $SAFETY_STOP) >& /dev/null &
Run command
if [ "${launchFLUENT}" = "OK" ] ; then
{
echo date >> $OUTPUT_NAME
if [ -f "autorestart.txt" ] && [[ $AUTO_RESTART == "True" ]]
then
# cas de reprise
# on choisit le journal a executer en lisant le fichier
# autorestart.txt
MYINPUT_FLUENT=$(head -1 autorestart.txt)
rm "autorestart.txt"
if ! [ -f ${MYINPUT_FLUENT} ]
then
echo "Cannot find restart journal ${MYINPUT_FLUENT}, reverting to ${INPUT_FLUENT}"
exit 1
MYINPUT_FLUENT=$INPUT_FLUENT
fi
fi
#lancement du script python qui lance fluent
python pyfluent.py
# Suppression du fichier des machines
rm -rf $WORKDIR/$MACHINEFILE
echo `date` >> $OUTPUT_NAME
if [ -f $SAFETY_STOP ]
then
    rm $SAFETY_STOP
    if [[ $AUTO_RESTART == "True" ]]
    then
        # si l'arrêt a été provoqué avant la fin, alors on crée
        # un journal de reprise et on relance le calcul
        /path1/TOOLS_ANSYS/fluent_autorestart/create_auto_restart.py $INPUT_FLUENT $MYINPUT_FLUENT
        sbatch $0
    fi
fi

}
else
{
echo "" >> $OUTPUT_NAME
#echo "aborted" >> REQ_COUNT_$SLURM_JOBID
}
fi`
And this is the pyfluent.py script:
`#! /path3/anaconda-3.9/bin/python
voir la doc https://fluent.docs.pyansys.com/user_guide/index.html
import os
import ansys.fluent.core as pyfluent
#with open('env.dat','w') as f:
f.write('PYFLUENT_FLUENT_ROOT='+str(os.environ.get('PYFLUENT_FLUENT_ROOT')))
#f.close()
#os.environ["PYFLUENT_FLUENT_ROOT"] = "/path4/ANSYS23.1/v231/fluent"
#passer show_gui à true pour voir l'interface graphique
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None )
solver.tui.file.read_case('test3.cas')
#solver.solution.run_calculation.iterate(number_of_iterations=5000)    `
Thanks.

This is the pyfluen.py script:
#! /path3/anaconda-3.9/bin/python
# voir la doc https://fluent.docs.pyansys.com/user_guide/index.html
import os
import ansys.fluent.core as pyfluent

#with open('env.dat','w') as f:
#   f.write('PYFLUENT_FLUENT_ROOT='+str(os.environ.get('PYFLUENT_FLUENT_ROOT')))
#f.close()
#os.environ["PYFLUENT_FLUENT_ROOT"] = "/path4/ANSYS23.1/v231/fluent"
#passer show_gui à true pour voir l'interface graphique
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None )
solver.tui.file.read_case('test3.cas')
#solver.solution.run_calculation.iterate(number_of_iterations=5000)

And this is the sbatch:
#!/bin/bash

###############################################################
###############################################################
#BEGINNING OF USER SECTION
###############################################################
###############################################################

#
# Batch options for SLURM (Simple Linux Utility for Resource Management)
# =======================
#
# Parametre utilisateur :
#   - specifier le nombre de serveurs de calcul a utiliser (--nodes=  )
#   - [option] : specifier le nom sous lequel le job va apparaitre dans le gestionnaire de queue (--job-name=  )
#   - specifier la version de FLUENT a utiliser (VERSION=  )
#
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=0-00:30:00
#SBATCH --partition=cn
#SBATCH --enable-turbo
#SBATCH --wckey=DTIPD:CFD
#SBATCH --job-name=PYFLUENT

###############################################################
###############################################################
#REMPLISSAGE BDD TEMPS D'ATTENTE
###############################################################
###############################################################

user_id=`whoami`
fullname=`getent passwd "$user_id" | cut -d: -f5 | cut -d, -f1`
job_duration=`sacct -n -X -j $SLURM_JOBID --format="Elapsed"`
job_date_submission=`sacct -n -X -j $SLURM_JOBID -o Eligible`
job_date_start=`sacct -n -X -j $SLURM_JOBID -o Start`
job_walltime=`sacct -n -X -j $SLURM_JOBID -o Timelimit`

# Convert date to seconds
a=`date --date $job_date_start +%s`
b=`date --date $job_date_submission +%s`

job_start_delay=$((a - b))

# Convert HH:MM:SS to seconds
c=`echo $job_walltime | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }'`

job_start_delay_percent=$((100*$job_start_delay/$c))

# Write some info to file "Database_Jobs_WaitingTime.dat"
echo "$SLURM_JOBID ; $user_id ;$job_duration;$job_walltime; $job_start_delay ; $job_start_delay_percent" >> /path1/SLURM/Database_Jobs_WaitingTime.dat

#-------------------------------------------------------------------------------
# NOM DU FICHIER JOURNAL DU CALCUL FLUENT
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INPUT_FLUENT=Launch_fluent_steady.jou
VERSION="22.2"
DIMENSION="3D"    # Specifier 2D ou 3D
MARGE_SECURITE=1800    # Arret du calcul avec enregistrement xxx secondes avant le Wall Time
AUTO_RESTART="False"    # True ou False : redémarrage automatique du calcul si celui-ci est arrêté à l'approche du Wall Time
module load ansys/$VERSION
module load anaconda/3.9

###############################################################
###############################################################
#END OF USER SECTION
###############################################################
###############################################################

# Liste des variables d'environnement SLURM
echo "SLURM_JOB_NODELIST=$SLURM_JOB_NODELIST"
echo "SLURM_NNODES=$SLURM_NNODES SLURM_TASKS_PER_NODE=$SLURM_TASKS_PER_NODE"
env | grep -e MPI -e SLURM
NBCPU=$SLURM_NPROCS

# Repertoire courant
WORKDIR=`pwd`

MYINPUT_FLUENT=$INPUT_FLUENT

# Liste des machines
MACHINEFILE="machinefile.$SLURM_JOBID.txt"
srun /bin/hostname -s | sort -u > $WORKDIR/$MACHINEFILE
srun hostname > ./FRB.$SLURM_JOB_ID

#export OMP_NUM_THREADS=1

# Change to submission directory
if test -n "$SLURM_SUBMIT_DIR" ; then cd $SLURM_SUBMIT_DIR ; fi

# Recuperation du nom du fichier de sortie
CASENAME=output_fluent
OUTPUT_NAME="${CASENAME%.*}.o$SLURM_JOBID"
NBCPU=$SLURM_NPROCS
HOSTFILE=hosts.$SLURM_JOBID
srun /bin/hostname > $HOSTFILE
MONPNPNODES=`awk '{for (i=1; i<=NF; i++)mot[$i]++} END {for (i in mot) {printf"%s,%s ",i,mot[i]}}' $HOSTFILE | sort -n -r`
rm -rf $HOSTFILE
USERSDIR="$BRIDGE_MSUB_PWD/ufile"
MYJOB=$SLURM_JOBID
SAFETY_STOP="safety_stop.$SLURM_JOBID"

echo "OUTPUT_NAME: "$OUTPUT_NAME

# Chargement du MPI
OPT_MPI="-mpi=intel"

###############################
###############################
# Gestion des licences (HPC anshpc / jetons calcul acfd_2)

# Recuperation du nombre de licences "acfd_2" disponibles
NB_DISPO_1=`/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of cfd_solve_level1:" | awk '{print $6-$11}'`
echo "1 jeton licence cfd_solve_level1 demande, $NB_DISPO_1 jeton(s) licence cfd_solve_level1 disponibles"

# Recuperation du nombre de licences "anshpc" disponibles
NB_DISPO_2=`/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of anshpc:" | awk '{print $6-$11}'`
echo $NB_DISPO_2
# Recuperation du nombre de licences "anshpc_pack" disponibles
NB_DISPO_pack=`/path_lic/FLEXlm/11_14_0_2/bin/lmutil lmstat -c 1055@licserverFQDN -S ansyslmd | grep "Users of anshpc_pack:" | awk '{print $6-$11}'`
if [ -z $NB_DISPO_pack] || [ $NB_DISPO_pack -lt 1] ; then
    NB_DISPO_3=0
else
    if [ $NB_DISPO_pack -lt 2 ] ; then
    NB_DISPO_3=12
    else
        if [ $NB_DISPO_pack -lt 3 ] ; then
        NB_DISPO_3=36
        else
            if [ $NB_DISPO_pack -lt 4 ] ; then
            NB_DISPO_3=132
            else
                if [ $NB_DISPO_pack -lt 5 ] ; then
                NB_DISPO_3=516
                else
                    if [ $NB_DISPO_pack -lt 6 ] ; then
                    NB_DISPO_3=2052
                    else
                        if [ $NB_DISPO_pack -lt 7 ] ; then
                        NB_DISPO_3=8196
                        else
                            if [ $NB_DISPO_pack -lt 8 ] ; then
                            NB_DISPO_3=32772
                            else
                                if [ $NB_DISPO_pack -lt 9 ] ; then
                                NB_DISPO_3=131076
                                else
                                    if [ $NB_DISPO_pack -lt 10 ] ; then
                                    NB_DISPO_3=524292
                                    else
                                        if [ $NB_DISPO_pack -lt 11 ] ; then
                                        NB_DISPO_3=2097156
                                          else
                                            if [ $NB_DISPO_pack -lt 12 ] ; then
                                            NB_DISPO_3=8388612
                                                else
                                            NB_DISPO_3=33554436
                                            fi
                                        fi
                                    fi
                                fi
                            fi
                        fi
                    fi
                fi
            fi
        fi
    fi
fi
NB_DISPO_hpc=$(($NB_DISPO_2 + $NB_DISPO_3))

# Evaluation du besoin en licences HPC ("anshpc" et "anshpc_pack")
if [ $SLURM_NTASKS -lt 4 ] ; then
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
    echo "   >> De 1 a 4 processeurs demandes :"                          >> $OUTPUT_NAME
    echo "   >> Le calcul ne prendra pas de licences HPC..."          >> $OUTPUT_NAME
    echo "   >> Seul un jeton cfd_solve_level1 suffit..."               >> $OUTPUT_NAME
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
    NB_NEED=0
else
    NB_NEED=$(( $SLURM_NTASKS - 4 ))
fi
echo "$NB_NEED HPC licences demandee, $NB_DISPO_hpc HPC licences disponibles" >> $OUTPUT_NAME

if [ $NB_DISPO_1 -eq 0 ] ; then # Cas ou il manque des jetons de calcul
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
    echo "   >> Il n'y a plus de licences cfd_solve_level1 disponibles...">> $OUTPUT_NAME
    echo "   >> Le calcul ne peut pas etre lance..."                >> $OUTPUT_NAME
    echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
    launchFLUENT="NotOK"
    echo "      Le calcul va etre remis en queue" >> $OUTPUT_NAME
    FILE_REQ_COUNT="REQ_COUNT_$SLURM_JOBID"
    if [ -f $FILE_REQ_COUNT ] ; then
         cm=`cat $FILE_REQ_COUNT`
         cm=$(( $cm + 1 ))
         echo "      C'est la $cm eme tentative" >> $OUTPUT_NAME
    else
         cm=1
         echo "      C'est la 1ere tentative" >> $OUTPUT_NAME
    fi
    echo $cm > $FILE_REQ_COUNT
    scontrol requeue $SLURM_JOBID
    sleep 240 # Le serveur peut mettre un peu de temps a rendre le requeue effectif
          # et a arreter le script en general on n attend pas les 4 minutes

else
    if [ $NB_NEED -ne 0 ] && [ $NB_NEED -gt $NB_DISPO_hpc ] ; then # Cas ou il manque des licences HPC
        echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
        echo "   >> Pas assez de licence HPC disponibles"               >> $OUTPUT_NAME
        echo "   >> Le calcul ne peut pas etre lance..."                >> $OUTPUT_NAME
        echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $OUTPUT_NAME
        launchFLUENT="NotOK"
        echo "    Le calcul va etre remis en queue" >> $OUTPUT_NAME
        FILE_REQ_COUNT="REQ_COUNT_$SLURM_JOBID"
        if [ -f $FILE_REQ_COUNT ] ; then
         cm=`cat $FILE_REQ_COUNT`
         cm=$(( $cm + 1 ))
         echo " C'est la $cm eme tentative" >> $OUTPUT_NAME
        else
         cm=1
         echo " C'est la 1ere tentative" >> $OUTPUT_NAME
        fi
        echo $cm > $FILE_REQ_COUNT
        scontrol requeue $SLURM_JOBID
        sleep 240 # Le serveur peut mettre un peu de temps a rendre le requeue effectif
              # et a arreter le script en general on n attend pas les 4 minutes

    else # Cas ou tout est disponible
        echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<"         >> $OUTPUT_NAME
        echo "   >> Le calcul a trouve un jeton licence cfd_solve_level1 disponible"  >> $OUTPUT_NAME
        echo "   >> ainsi que le nombre de licences HPC demande"                      >> $OUTPUT_NAME
        echo "   >> Le calcul peut etre lance..."                             >> $OUTPUT_NAME
        echo "   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<"         >> $OUTPUT_NAME
        launchFLUENT="OK"
    fi
fi

###############################
###############################

# Dimension du probleme
if [ $DIMENSION = "2D" ] ; then
   OPT_DIM="2ddp"
fi
if [ $DIMENSION = "3D" ] ; then
   OPT_DIM="3ddp"
fi

# Marge de securite pour sauvegarde avant atteinte du Wall Time
echo "SLURM_JOBID=$SLURM_JOBID" >> $OUTPUT_NAME
PTIME=`sacct -j $SLURM_JOBID -o Timelimit -X --noheader`
echo "PTIME=###"$PTIME"###" >> $OUTPUT_NAME
echo "len(PTIME)="`echo $PTIME | wc -c` >> $OUTPUT_NAME
while [ `echo $PTIME | wc -c` -lt 5 ] ; do
   echo "Tentative de recuperation du Wall Time..." >> $OUTPUT_NAME
   sleep 1
   PTIME=`sacct -j $SLURM_JOBID -o Timelimit -X --noheader`
   echo $PTIME >> $OUTPUT_NAME
done

DD=0
RESTE=$PTIME
if [ `echo $PTIME | grep "-" | wc -l` = 1 ] ; then
   DD=`echo $PTIME | cut -d "-" -f1`
   RESTE=`echo $PTIME | cut -d "-" -f2`
fi
timeLimit=`echo $RESTE | awk 'BEGIN{FS=":"}{print DD*86400+$1*3600+$2*60+$3-MARGE_SECURITE}' DD=$DD MARGE_SECURITE=$MARGE_SECURITE`

echo "WallTime = $PTIME" >> $OUTPUT_NAME
echo "timeLimit = $timeLimit s" >> $OUTPUT_NAME
( sleep $timeLimit ; stop_fluent $OUTPUT_NAME ; touch $SAFETY_STOP) >& /dev/null &

# Run command
if [ "${launchFLUENT}" = "OK" ] ; then
   {
    echo `date` >> $OUTPUT_NAME
    if [ -f "autorestart.txt" ] && [[ $AUTO_RESTART == "True" ]]
    then
        # cas de reprise
        # on choisit le journal a executer en lisant le fichier
        # autorestart.txt
        MYINPUT_FLUENT=$(head -1 autorestart.txt)
        rm "autorestart.txt"
        if ! [ -f ${MYINPUT_FLUENT} ]
        then
            echo "Cannot find restart journal ${MYINPUT_FLUENT}, reverting to ${INPUT_FLUENT}"
            exit 1
            MYINPUT_FLUENT=$INPUT_FLUENT
        fi
    fi
    #lancement du script python qui lance fluent
    python pyfluent.py
    # Suppression du fichier des machines
    rm -rf $WORKDIR/$MACHINEFILE

    echo `date` >> $OUTPUT_NAME
    if [ -f $SAFETY_STOP ]
    then
        rm $SAFETY_STOP
        if [[ $AUTO_RESTART == "True" ]]
        then
            # si l'arrêt a été provoqué avant la fin, alors on crée
            # un journal de reprise et on relance le calcul
            /path1/TOOLS_ANSYS/fluent_autorestart/create_auto_restart.py $INPUT_FLUENT $MYINPUT_FLUENT
            sbatch $0
        fi
    fi
  }
else
   {
   echo "" >> $OUTPUT_NAME
   #echo "aborted" >> REQ_COUNT_$SLURM_JOBID
   }
fi

Thanks.

My guess here is that fluent main process is launched on a different machine than the machine onto python is executed.  (this is triggered by the SLURM_JOB_NODELIST).
By experience, when a file is created on another machine, it might appear as "empty" for a while, but the filesystem should sync the content after some time.  But is this machine specific.
... can you confirm that the server info file is empty and "stays" empty even after some time has passed?
@prmukherj  in await_fluent_launch, i suggest that the condition checks not only for mtime, but also for non-zero file size.

Yes, you should be able to pass the server_info_filepath argument to launch_fluent:
https://fluent.docs.pyansys.com/release/0.13/api/general/launcher/index.html#ansys.fluent.core.launcher.launcher.launch_fluent
You might also want to rule out some of the additional details in your sbatch script and try something simple as mentioned in the documentation:
https://fluent.docs.pyansys.com/release/0.13/user_guide/launching_ansys_fluent.html#scheduler-support

Hi @dnwillia , the customer ran two tests.
Before launching the calculation, the customer created an empty serverinfo file, then run this script :
import os
import ansys.fluent.core as pyfluent

serverfilepath = os.path.realpath('.')+'/serverinfo'

print(serverfilepath)

#passer show_gui à true pour voir l'interface graphique
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=serverfilepath )
solver.tui.file.read_case('test3.cas')
solver.solution.run_calculation.iterate(number_of_iterations=5000)

the output of the calculation is as follows, the serve info file is empty and the error message is as follows:
/var/spool/slurmd/job28701660/slurm_script: ligne 123 : [: « ] » manquant
/var/spool/slurmd/job28701660/slurm_script: ligne 123 : [: « ] » manquant
/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/serverinfo
Traceback (most recent call last):
  File "/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/pyfluent.py", line 17, in <module>
    solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=serverfilepath )
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/launcher/launcher.py", line 465, in launch_fluent
    ip, port, password = parse_server_info_file(server_info_filepath)
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 28, in parse_server_info_file
    ip_and_port = lines[0].strip().split(":")
IndexError: list index out of range
Failed to connect to bus: Connexion refusée

If the customer doesn't create this serverinfo file and runs this script specifying only the path of the calculation without a server info file :
import os
import ansys.fluent.core as pyfluent

serverfilepath = os.path.realpath('.')+'/'

#passer show_gui à true pour voir l'interface graphique
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=serverfilepath )
solver.tui.file.read_case('test3.cas')
solver.solution.run_calculation.iterate(number_of_iterations=5000)

The calculation output tells that the server_info_filepath is of type directory and this gives the following error:
/var/spool/slurmd/job28739720/slurm_script: ligne 123 : [: « ] » manquant
/var/spool/slurmd/job28739720/slurm_script: ligne 123 : [: « ] » manquant
/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/
Traceback (most recent call last):
  File "/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/pyfluent.py", line 17, in <module>
    solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=serverfilepath )
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/launcher/launcher.py", line 465, in launch_fluent
    ip, port, password = parse_server_info_file(server_info_filepath)
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 26, in parse_server_info_file
    with open(filename, encoding="utf-8") as f:
IsADirectoryError: [Errno 21] Is a directory: '/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/'
Failed to connect to bus: Connexion refusée

Has the customer made a mistake?

The way it works is that PyFluent should tell Fluent where to write the server info file:
server_info_file = os.path.join("home", "dnwillia","dnw-serverinfo")
pyfluent.launch_fluent(precision="double",  mode="solver", server_info_filepath=server_info_file)
...

In this case I think Fluent would write the file at the provided path so it's not necessary to create it or pass start-instance.  You only need to pass start-instance if you are connecting to an already running Fluent session that was not shut down.

@dnwillia-work the customer tested this:
import ansys.fluent.core as pyfluent server_info_file = os.path.join(os.path.realpath('.'),"serverinfo") solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=server_info_file ) solver.tui.file.read_case('test3.cas') solver.solution.run_calculation.iterate(number_of_iterations=5000)
Unfortunately the serverinfo i still not created with this error:
Traceback (most recent call last):
  File "/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/pyfluent.py", line 17, in <module>
    solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=server_info_file )
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/launcher/launcher.py", line 465, in launch_fluent
    ip, port, password = parse_server_info_file(server_info_filepath)
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 26, in parse_server_info_file
    with open(filename, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/serverinfo'
Failed to connect to bus: Connexion refusée

authors: ClaraPicoron dnwillia dnwillia-work lagacep-ans

repo: pyansys/pyfluent


text:
Some pages are broken in dev docs

Compare https://dev.fluent.docs.pyansys.com/api/core/solver/settings.html with https://fluent.docs.pyansys.com/api/core/solver/settings.html. If you scroll the issue is clear. This doesn't look good.

Do you mean that the style is a bit different.  eg: the release doc uses different colors for the emphasized objects/methods.

Do you mean that the style is a bit different? eg: the release doc uses different colors for the emphasized objects/methods.
I see the content is different/updated in the development version, which is fine.

At the time of raising the issue I was seeing the table of contents rendering messed up. I was actually looking at it today and it looked fine, so that might have been a temporary glitch or browser issue. Let me monitor before closing.

OK, cool.  One reason for differences can be the differences in upgraded requirements.  For instance:
https://github.com/pyansys/pyfluent/blob/main/requirements/requirements_doc.txt
https://github.com/pyansys/pyfluent/blob/release/0.11/requirements/requirements_doc.txt
On main we've upgraded Sphinx version, Ansys theme version, etc...

I guess we can close this one then since it seems to have been a glitch.

authors: dnwillia-work seanpearsonuk


text:
Add some standard battery models from papers

We are now at the stage where it might be useful to add some standard "full" battery models from the literature with exactly the degradation models (model options) and parameter set used in that model.
Something like
class OKane2020(DFN):
   def __init__(self):
        options = {"plating": "reversible"}
        super().__init__(self, options=options, name="O'Kane 2020 model")

   @property
   def default_parameter_values(self):
       return pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Chen2020_plating)

Then the model can be used as pybamm.lithium_ion.OKane2020().
To start with:

Yang 2017
O'Kane 2020
Ai 2020

Doing this for the @weilongai and @drsokane papers should be fairly easy as a first issue. Can you comment here exactly which options and parameters are needed for this?
For the Yang2017 paper, it is slightly more involved as it needs a new parameter set.

Hi @tinosulzer , this sounds to be a good idea, and I would suggest the following class. Are you going to make the DFN by default?
class Ai2020(DFN):
   def __init__(self):
        options = {   "particle": "Fickian diffusion",   "particle cracking": "both" }
        super().__init__(self, options=options, name="Ai 2020 model")

   @property
   def default_parameter_values(self):
       return pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Ai2020)

Thanks

Are you going to make the DFN by default

I guess whichever model the paper uses as the underlying model

I actually used the Ecker et al. parameter set in my 2020 paper, not Chen et al. I used Chen et al. in the example because I was unable to implement the model in my paper, for two reasons:

The nonlinear diffusion function currently in PyBaMM for Ecker et al. is an approximation used by Ivan Korotkin to fit discharge curves at various C-rates, and is not the real diffusivity data. PyBaMM did not converge when an analytic fit to the real diffusivity data was used. (Even COMSOL struggled!)
The charging protocol in my 2020 paper cuts off at 80% SoC, determined by Coulomb counting. I don't believe this has yet been implemented in the Experiment class.
Implementing full nonlinear diffusion in PyBaMM is #1 on my list of long-term goals but I urgently need to get another paper out before I can work on this.

I urgently need to get another paper out before I can work on this.

don't we all 😅

I am working on implementing the nonlinear diffusion coefficients for the LG M50, if that helps :)

Hi everyone,
I am Kenneth Nwanoro. I joined the Lancaster energy storage group couple of months ago.
Recently, I have started using Pybamm for battery modelling. I just wanted to say that I will implement the Yang 2017 model. This may take a little time as I will need to find all the parameters values used in the paper (not all the parameters values were given in the paper). Many thanks.

Thanks @KennethNwanoro . When you have the Yang2017 model ready could you add it please (with the wrong parameters for now), to avoid duplication of work as I am aware of some other projects that will also want to use that model. I believe the following options give you the model or very close:
{"sei": "ec reaction", "sei film resistance": "distributed", "sei porosity change": "true", "lithium plating": "irreversible"}

We might just need to add an option for porosity change due to plating

Thanks @tinosulzer. I have already started creating the Yang2017 model as you can see below. I will now include the "sei film resistance" option as suggested.
class Yang2017(DFN):
def init(self):
options = options = {"sei": "ec reaction limited", "sei porosity change": "true", "lithium plating": "irreversible"}
super().init(self, options=options, name="Yang 2017")
@property
def default_parameter_values(self):
return pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Yang2017)

thanks, would be awesome if you could also help us double check the equations are indeed the same
btw, you can write code in github by enclosing it in a block with ```python3 and ```

Thanks @tinosulzer. I don't know if this is the right place to post this.  I have compared the degradation (SEI and irreversible Li plating) model equations from Yang2017 and the irreversible Li-plating model currently in PyBaMM. There are some slight differences:

The irreversible lithium-plating model currently in PyBaMM uses reaction rate constant parameter and is also dependent on electrolyte concentration, while Yang2017 is based on a constant current exchange density. This will likely give different trends in results if the current
Li-plating model is used for the Yang 2017 because of variation in electrolyte concentration. Because of this, a suitable
reversible Li-plating model for Yang 2017 is likely to be added. Or is there a way to change this to constant exchange current density parameter without having to create another irreversible lithium plating model class  or modifying the
present irreversible Li plating model class to include the option of constant current density for the cathodic Tafel equation used for the irreversible Li plating? If not, I will have to add the constant exchange current density option for the irreversible lithium plating.

The SEI reactions (currently in PyBaMM and Yang2017) are based on the EC reaction limited and look similar. I have tried recasting the EC reaction limited SEI model in PyBaMM to dimensional form and it looks similar that in Yang2017. However, is it possible to also post  or give reference to the dimensional form of the EC limited SEI reaction model currently in PyBaMM for proper comparison?.

In the Yang2017, the total film thickness is required in updating the electrolyte porosity. This includes film thickness growth due to irreversible lithium plating as well as SEI reactions. In the porosity class, currently only the SEI reaction contributes to the total film thickness and porosity change. This can be found for example in the "full_reaction_driven_porosity" class.

Many thanks.

Hi @KennethNwanoro ,

For the "main" reaction, exchange-current density is given as a FunctionParameter (which usually has the standard square root dependencies). For consistency, I suggest we do the same with the exchange current densities for forward and backwards plating reactions
The EC reaction model in pybamm is based on Yang 2017 so I do expect them to be similar. Generally, we should put together a better reference for the SEI models, see #1260
Yes, the full_reaction_driven_porosity" class should be updated to also simulate change in porosity due to lithium plating. For example, we could add a "lithium plating porosity change" option that is like "sei porosity change", and then have options to add terms to deps_dt` depending on which options are set

Hi@tinosulzer,
I see, using FunctionParameter with conditional statements could be used for the plating exchange current densities.
What is your suggestion regarding the electrolyte concentration term c_e_n  in the present Li-plating in PyBaMM which is not required in Yang2017 model:
            -(1 / C_plating)
            * c_e_n
            * (pybamm.exp(-0.5 * (phi_s_n - phi_e_n + phi_ref + eta_sei)))
        )```

Do you think using  ```FunctionParameter``` for the electrolyte concentration term here will be a good idea so that conditional statement can be used to keep the value to unity if Yang2017 instance is true?

Yes, the c_e term should go into the exchange-current density function.
You actually don't need a conditional statement. See the following example for what happens where a "function parameter" is given a scalar as an input
import pybamm

c = pybamm.Variable("c")
f = pybamm.FunctionParameter("f", {"c": c})

# Processing with a scalar behaves like a normal parameter
param1 = pybamm.ParameterValues({"f": 2})
param1.process_symbol(f) # returns a Scalar with value 2

# Processing with a function behaves like a function
param2 = pybamm.ParameterValues({"f": lambda x: x ** 2})
param2.process_symbol(f) # returns c ** 2

Hi @tinosulzer,
Could you please check this function out and see if it is what you have in mind.  The function will return both exchange current density scale and c_e_n  values suitable for both Yang2017 (with constant lithium plating exchange current density that is independent of concentrations) and concentration dependent exchange current density (e.g. OKane2020).
       """ Exchnage current density  scale and
       # also returns correct electrolyte concentration value for Lithium plating model type"""
       inputs = {"electrolyte concentration":c_e_n, }

       fun_Li_pating= pybamm.FunctionParameter("electrolyte concentration", inputs)

       if self.options["lithium plating exchange current density value"] != "constant":
           c_plating = self.j_scale_n / self.j0_plating_dimensional
           plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": lambda x: x})
           plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns true value of c_e_n

       else:
           c_plating = (self.j_scale_n / self.m_plating_dimensional) * pybamm.exp(
               -self.F * self.U_n_ref) / (2 * self.R * self.T_ref)
           plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": 1})
           plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns electrolyte concentration a Scalar with value 1

       return (c_plating , plating_c_e_n)```

For some reason, some parts of the code disappeared. See below.
def C_plating(self, c_e_n):
""" Exchnage current density  scale and
# also returns correct electrolyte concentration value for Lithium plating model type"""
inputs = {"electrolyte concentration":c_e_n, }
    fun_Li_pating= pybamm.FunctionParameter("electrolyte concentration", inputs)

    if self.options["lithium plating exchange current density value"] != "constant":
        c_plating = self.j_scale_n / self.j0_plating_dimensional
        plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": lambda x: x})
        plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns true value of c_e_n

    else:
        c_plating = (self.j_scale_n / self.m_plating_dimensional) * pybamm.exp(
            -self.F * self.U_n_ref) / (2 * self.R * self.T_ref)
        plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": 1})
        plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns electrolyte concentration a Scalar with value 1

    return (c_plating , plating_c_e_n)

Kind of but not quite - just need to put the code in different places. I'll open a branch with the main changes required and you can look at the diff on github

Great, please let me know when this is done.
Many thanks.

Here you go: https://github.com/pybamm-team/PyBaMM/compare/yang-model
Now for the Yang model you just need to update the plating_exchange_current_density and stripping_exchange_current_density functions, i.e. replace with a constant

Great, got that now.

I have couple of questions regarding the porosity change submodel:

The expression for the porosity-time derivative includes this parameter  beta_surf_n   which is described as an electrolyte property (please see lithium_ion_parameters.py file). It is given a value of 0. My question is, why include this term in  the porosity-time derivative expression when it is actually 0 or is it updated elsewhere?  This question is important because, for Lithium plating induced porosity change, I would like to know if the term beta_surf_n is required?

The full reaction driven porosity class needs to be updated to account for lithium plating induced porosity change and also coupled SEI and lithium plating induced porosity change options. I preferred doing slight modifications in the current  full reaction driven porosity class to include the two additional options which are

SEI induced porosity change is false while it is true for lithium plating porosity change (i.e., user is only interested in lithium plating)
When both SEI and lithium plating porosity change are required e.g. Yang2017.
The code below (also currently available in my own branch) is the modification of the get_coupled_variables function:

def get_coupled_variables(self, variables):

        j_n = variables["Negative electrode interfacial current density"]
        j_p = variables["Positive electrode interfacial current density"]

        if self.options["sei porosity change"] == "true" and self.options["lithium plating porosity change"] == "false":

             j_sei_n = variables["Negative electrode sei interfacial current density"]
             beta_sei_n = self.param.beta_sei_n
             deps_n_dt = -self.param.beta_surf_n * j_n + beta_sei_n * j_sei_n

        elif self.options["lithium plating porosity change"] == "true" and self.options["sei porosity change"] == "false":

            j_plating = variables[
            "Negative electrode lithium plating interfacial current density"
        ]
            beta_plating = self.param.beta_plating

            deps_n_dt = -self.param.beta_surf_n * j_n + beta_plating * j_plating

        elif self.options["lithium plating porosity change"] == "true" and self.options["sei porosity change"] == "true":

            j_plating = variables[
            "Negative electrode lithium plating interfacial current density"
        ]

            j_sei_n = variables["Negative electrode sei interfacial current density"]

            beta_plating = self.param.beta_plating
            beta_sei_n = self.param.beta_sei_n

            deps_n_dt = -self.param.beta_surf_n * j_n + beta_sei_n * j_sei_n + beta_plating * j_plating

        deps_s_dt = pybamm.FullBroadcast(
            0, "separator", auxiliary_domains={"secondary": "current collector"}
        )

Or would you rather prefer separate class for each of the two additional options listed above?
For example, full_lithium_plating_driven_porosity_change and full_lithium_plating_with_SEI_driven_porosity_change .
If this is the case, then I will have to created another two additional classes similar to leading_reaction_driven_porosity to account for the two additional options for the leading order models.
I will now wait until I hear your preference.

why include this term in the porosity-time derivative expression when it is actually 0

The beta_surf_n parameter accounts for changes in porosity due to the "main" reaction. This is zero for lithium-ion, but we have it there so that we can reuse the same submodel for lead-acid (and any other chemistry where there are porosity changes due to the main reaction).

I preferred doing slight modifications in the current full reaction driven porosity class to include the two additional options

Yes, I also prefer this way to adding separate classes. You can make the code a little bit cleaner as follows
def get_coupled_variables(self, variables):

        j_n = variables["Negative electrode interfacial current density"]
        j_p = variables["Positive electrode interfacial current density"]
       deps_n_dt = -self.param.beta_surf_n * j_n

        if self.options["sei porosity change"] == "true":

             j_sei_n = variables["Negative electrode sei interfacial current density"]
             beta_sei_n = self.param.beta_sei_n
             deps_n_dt += beta_sei_n * j_sei_n

        elif self.options["lithium plating porosity change"] == "true":

            j_plating = variables[
            "Negative electrode lithium plating interfacial current density"
        ]
            beta_plating = self.param.beta_plating

            deps_n_dt += beta_plating * j_plating

        deps_s_dt = pybamm.FullBroadcast(
            0, "separator", auxiliary_domains={"secondary": "current collector"}
        )
        deps_p_dt = -self.param.beta_surf_p * j_p

The Yang2017 model is ready. The initial test results looks reasonable. I was wondering if there is any kind of standard benchmark tests for the SEI and lithium plating models for comparison before creating pull request?

We don't have benchmark tests, only the StandardOutputTests, feel free to open a PR and we'll let you know if any tests are missing

authors: DrSOKane KennethNwanoro brosaplanella tinosulzer weilongai

repo: pybamm-team/PyBaMM


text:
Functions to nest and flatten dictionaries for the datasets

Description
There are 2 functions, one which nests dictionaries and one which flatten the nested dictionaries based on a set of categores which are listed out
Fixes # (issue)
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

[x] New feature (non-breaking change which adds functionality)
[ ] Optimization (back-end change that speeds up the code)
[ ] Bug fix (non-breaking change which fixes an issue)

Key checklist:

[x] No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
[ ] All tests pass: $ python run-tests.py --all (or $ nox -s tests)
[ ] The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).
Further checks:

[x] Code is commented, particularly in hard-to-understand areas
[ ] Tests added that prove fix is effective or that feature works

@Ubham16 Also, we went to a source layout recently. So your all the files in pybamm moved to src/pybamm


text:
Python math module implementation complete

Except fsum , all other functions of math module added.
I will implement fsum and add tests within two days.

Python math module implementation complete. Ready for review.

@cflee Thanks a lot for reviewing my PR.
I apologize for the size of this PR and I will surely keep this in mind in the future.

About the code style.

I chose to import the classes because then it would be less cumbersome to write the code. And I thought this made the code more readable and clean?
I will change the annotations to agree with the rest of the code.
For the tests, I followed the existing tests suite for str and others. I do agree that the test for a single function can be inside one assertCodeExecution() block but instead I chose to follow the existing format. I shall definitely change this if this helps in faster execution of the test suite.
It seems I have not properly used whitespaces. I will update the PR after adding those properly.

The erf() and gamma() implementation are from the Jython modules.I have attached the files here.

I tried different test cases and found the exceptions raised by python and implemented them, hence the same exceptions are raised in VOC as in python.

tofloatvalue() is indeed a helper method that is supposed to be private . I did not notice this until now. I shall change this and bring consistency in the naming of helper methods.
I will update the test cases for factorial() and other such methods(if any) to check for non-error output as well.
ceil(x),floor(x) & trunc(x) are the methods in python math module that delegate to x.__ceil__()  and so on respectively.  I will update these methods too.

The code for erf() and gamma() from jython modules:-
math_gamma.java.zip
math_erf.java.zip

@dibyadas

The code for erf() and gamma() from jython modules

Ok, the size of this PR makes a lot more sense since much/most (?) of the math module is ported from Jython. Assuming the porting went correctly, I think the main issues will be with the tests – we need to make sure the method implementations are correct, and stay correct. I'm not sure if the test cases can be derived from Jython as well?

I chose to import the classes because then it would be less cumbersome to write the code. And I thought this made the code more readable and clean?

Yes, I agree that it usually makes things more readable.
However, for cases like Object, most folks who are familiar with Java will expect that to be java.lang.Object, not org.python.types.Object. Or for List, there's a fair amount of VOC code that interacts with both java.util.List (when making tuples) and org.python.types.List, and I think being non-ambiguous is very helpful.

For the tests, I followed the existing tests suite for str and others.

Yup, that's the case, but I'm trying to slowly change this by asking new contributions to have fewer assertCodeExecution() where possible, for each test_abc() part.
@freakboy3742 Is there anything we need to do to comply with making a derivative work from Jython under the PSF License? As far as I can tell the only requirement for derivative works is "a brief summary of the changes made".

@cflee Your analysis matches my understanding. We could use Jython code as the basis for functionality in VOC, as long as we give credit and provide a "brief summary" of any changes we make. That particular turn of phrase is delightfully vague, but shouldn't be too hard to comply with in both letter and spirit.

@cflee I have made changes according to your suggestions. Interestingly, the factorial implementation is somewhat faulty. This implementation works only for calculating factorial of small numbers, up-to 12 or something. It returns 0 for numbers greater than that. While CPython can go much more than that. This went completely unnoticed. Probably, this happened because I missed the non-error test cases for factorial functions. I did a bit of research and I found some good algorithms like Poor man's algorithm and this which can be used to calculate factorial of large numbers in Java. I guess the PR for implementing this will be a bit long. So I think it will be better if this PR is merged before that is opened.
This PR is ready for another review.

Hi @cflee. This PR has been lying around for a long time. The implementation is almost complete and is ready for another review. I will implement the factorial method as soon as possible and make another PR.

@cflee Apologies for being late. I've gotten quite busy with some other things.
As I said earlier, the factorial implementation will be big. To correctly work like CPython's does, it'll need quite a bit of work. I think its best to merge this PR (after the required changes have been made), and keep  the factorial PR different. Its just my opinion. I'll try to fix and push the other changes and notify you.
With Best Regards,
Dibya Prakash Das

@eliasdorneles  I don't think so. I've become a bit occupied at this moment. Also, there have been some changes that I haven't followed. It'll take me some time to understand them. Truly sorry about this. :(
You can close this PR if you wish.

@dibyadas No worries at all! Thanks for contributing anyway -- even if this isn't merged, it was a good discussion! =)
I'll close it, anyone wanting to continue this feel free to create a new one.

authors: cflee dibyadas eliasdorneles freakboy3742

repo: pybee/voc


text:
Investigate test_truncated_gz failure

Possibly the simplification of PipedGzipReader.read introduced in #14 sometimes causes a test failure, as seen on Travis.

Hmmm. I can run this through hyperfine with a 100 runs. Using conda I can test multiple interpreters.
If that helps.

I can now actually reproduce this locally with while tox; do true; done. This failed after a minute or so.

I think it’s a timing issue in PipedGzipReader.close().

I cannot reproduce the error on my machine. Which makes me suspect that it is a race condition, and this machine is just to fast to get it.
I made a small fix in #17 which should prevent the race condition from happening.

I also thought that adding a .wait() would be an idea, but there’s a big warning in the docs that it can deadlock when used with stdout=PIPE, which we do use. The intention of the previous code within read() and readline() was to trigger the .wait() only when we were sure that we were already at EOF, which would imply that the process won’t write any further data into the kernel buffer.
I’m not sure that a self.process.terminate() followed by an immediate self.process.wait() cannot deadlock. When you read just a couple of bytes from a file and then close it before reaching the end, perhaps the signal gets queued and delivered only after the process has managed to fill the buffer already.
However, I don’t see this happening in my tests and the PR fixes this particular issue.

I also thought that adding a .wait() would be an idea, but there’s a big warning in the docs that it can deadlock when used with stdout=PIPE, which we do use. The intention of the previous code within read() and readline() was to trigger the .wait() only when we were sure that we were already at EOF, which would imply that the process won’t write any further data into the kernel buffer.

When working on pytest-workflow I have experienced issues with .wait() because I was piping stdout and sterr of a workflow engine to a PIPE and the process hanged in production because long pipelines produce more stdout than 64kb.
Apperently Popen.communicate() can fix this. I used it successfullty with pytest-workflow.
https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen.communicate

I’m not sure that a self.process.terminate() followed by an immediate self.process.wait() cannot deadlock. When you read just a couple of bytes from a file and then close it before reaching the end, perhaps the signal gets queued and delivered only after the process has managed to fill the buffer already.

I think .wait() should not cause any problems here. There are two situations when the file is closed:

Everything finished succesfully. The process has an exit code. No problems there.
The (python) program crashes and pigz is still running. Process.terminate will run in this case. Even if the kernel buffer is full the process gets a signal and it will terminate. If the buffer is full it is just waiting for it the buffer to empty, but that should not block process signals.

So far the theory. I guess time will tell if it is correct...

Popen.communicate() reads all the data at once. Because we want to stream in xopen, it doesn’t help here.
Regarding wait + terminate, I forgot that if a process (pigz) is blocked on a write(), it will still receive signals. So it should work.

Note that I just pushed bfc714d, which fixes another issue that I saw when running the tests repeatedly. I’ll tag another release shortly.

Revisiting this because of https://github.com/pycompression/xopen/pull/63#issuecomment-837644218: My comment about communicate() wasn’t thought out – I understand that we should rewrite everything to use communicate(), but using communicate() just before shutdown should be fine and solve this problem.

authors: marcelm rhpvorderman

repo: pycompression/xopen


text:
update en/guideline and en/privacy_policy creativecommons offical URL

(Thanks for sending a pull request! Please fill in the following content to let us know better about this change.)
Types of changes
Please put an x in the box that applies

[ ] Bugfix
[ ] New feature
[ ] Refactoring
[ ] Breaking change (any change that would cause existing functionality to not work as expected)
[ ] Documentation Update
[x] Other (please describe)

Description
previous English version URL was zh_TW official URL , must to change EN official URL.
Related Issue
#854

Codecov Report

Merging #872 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #872   +/-   ##
=======================================
  Coverage   75.98%   75.98%
=======================================
  Files          70       70
  Lines        2727     2727
=======================================
  Hits         2072     2072
  Misses        655      655

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10c1fc6...d68bda4. Read the comment docs.


text:
Can't load extra tag for tags used in helper

I've got the following helper:
    @property
    def helper(self):
        helper = FormHelper()
        helper.layout = Layout(Div(HTML("
Login
"),
                                   'username',
                                   'password',
                                   Submit('save', _('Login'), css_class="purple huge float_left"),
                                   css_class="float_left box"),
                               Div(HTML("

"),
                                    HTML('{% trans "Register" %}'),
                                   css_class="box float_right center"),
                               )
        return helper

As you can see, I have a link with my custom tag "url_persist", but I can't get the tag to load. In addition the i18n tag doesn't load either, which is required for "trans". I've tried overriding various templates including field.html, uni_form.html, whole_uni_formset.html and including the load tag, but to no avail. Where can I load the custom tags?
(sorry, hit submit too fast)

Hi,
I haven't needed this before. But I'm guessing you would have to do:
HTML("""
    {% load your_tags %}
    <a href="{% url_persist register %}" class....
""")

Forget about the trans tag, using HTML, Django doesn't have i18n support for anonymous templates. Today I'm adding a layout object named TemplateInclude that will let you have this in a named template like:
TemplateInclude('dashboard/menu.html')

There you will be able to use {% trans %} tag. If you want to have i18n stuff, your best bet is use i18n strings with format:
HTML('%s {{ username }}' % _("Welcome to the jungle"))

Let me know how the template loading goes, regards,
Miguel

One more thing, I recommend you re-read the docs. Helpers are properties are not the recommended way anymore. You can have FormHelpers as class-level variables or instance-level variables. Read on it, the way you are doing it now is dropping performance.
Cheers,
Miguel

Including the load in the html worked, thanks.
The reason for the @property way was that that's what django-uni-form docs showed when I started implementing my last project. I'm going the be updating it so the method will be called from the init method.

I know, those were the old docs. I've been working on updating them. If you use a property without attaching it to a variable, every time you call it, you start from scratch.
I'm glad it works. I will let you know when TemplateInclude is around.
Regards,
Miguel

I'm rewriting my forms to look like this, which should be better, right?
'''python
def init(self, *args, **kwargs):
self.helper = self.get_helper()
super(LoginForm, self).init(*args, **kwargs)
def get_helper(self):
    helper = FormHelper()
    return helper

'''

Right, but only have the helper as an instance-level variable if you are changing the layout in the views. Otherwise you should be using a class-level variable, that has better memory footprint and performance:
class ExampleForm(forms.Form):
    [...]

    helper = FormHelper()
    helper.layout = Layout(...)

Regards,
Miguel

authors: joelhaasnoot maraujop

repo: pydanny/django-uni-form