Impossible to implement Branching rules

Hello,
I'm trying to implement a branching rule in python, however i think it is not possible yet since we cannot create new child node.
Issue #106 refers a possible solution however the GitHub branch is quite old and i would expect it to not work with the current release of scip.
Do you have any solution or maybe I missed something?
Many thanks!

Hi
You are right. That branch will not work and right now you cannot create children.
However, taking the stuff that you need from that branch should be complicated and you can extend the interface! I created a branch fs/branching-rules and put some of the methods for branching from the old branch. I haven't tested, but I guess it will work. You can try it and add any other method that you might need.
If you add more methods, please, open a pull request.

@fserra Hi, I am also implementing branch and price follow the test_coloring example. After cloning your branch and add some necessary declaration (i.e. SCIP_VARDATA and SCIPvarGetData) in .pyd file, I ran python setup.py install. However, when using "getLPBranchCands" and "createChild" func, a segmentation error would always occur. I suppose the problem is caused by PY_SCIP_CALL(xxx....). Did you actually notice this situation and got some ideas in tackling it?

Hi @andynuaa I haven't seen such problem. To debug you can use python setup.py install --debug but I think you have to use an scip compiled in debug mode (@mattmilten is this right?). You would have to compile SCIP in debug and then tell PySCIPOPT to use that one (SCIPOPTDIR=/path/to/install/debug/mode/scip python setup.py install --debug)
But, why did you need to SCIPvarGetData? This shouldn't be necessary.

Thanks for your timely response @fserra ! After reruning setup.py(didn't declare these func or struct aforementioned) with your instruction, I got the following error message.
$ SCIPOPTDIR=/home/Downloads/scipoptsuite-6.0.0/scip/bin python setup.py install
Compiling src/pyscipopt/scip.pyx because it changed.
[1/1] Cythonizing src/pyscipopt/scip.pyx
Error compiling Cython file:
...
cdef int npriolpcands
PY_SCIP_CALL(SCIPgetLPBranchCands(self._scip, &vars, NULL, &lpcandsfrac, NULL, &npriolpcands, NULL))
PyVars = []
fracs = []
for i in range(npriolpcands):
PyVars.append(SCIPvarGetData(vars[i]))
^
src/pyscipopt/scip.pyx:2449:36: undeclared name not builtin: SCIPvarGetData
Error compiling Cython file:
...
cdef int npriolpcands
PY_SCIP_CALL(SCIPgetLPBranchCands(self._scip, &vars, NULL, &lpcandsfrac, NULL, &npriolpcands, NULL))
PyVars = []
fracs = []
for i in range(npriolpcands):
PyVars.append(SCIPvarGetData(vars[i]))
^
src/pyscipopt/scip.pyx:2449:55: Cannot convert 'SCIP_VAR *' to Python object
Traceback (most recent call last):
File "setup.py", line 53, in
extensions = cythonize(extensions)
File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py", line 1026, in cythonize
cythonize_one(*args)
File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py", line 1146, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: src/pyscipopt/scip.pyx
Just are these errors that motivated me to declare SCIPvarGetData.
Because I wanna carry out Ryan/Foster branching rule, so the 2 funcs are necessary to me. Thanks again for all your warm help.

oh, I see. I am so sorry. I forgot to remove that line. I fixed it now and pushed to the branch the fix. You shouldn't need SCIPvarGetData. That was an experiment that didn't work so well ;)
I didn't test it though, so let me know if there is another problem.
Anyway, functions for branching should be added soon to master, see #208

Thanks again! Remaining parts seem works well in my instance. I will keep you informed with any other possible pits.

Hi @fserra , another question rised when I tried to do benders decomposition by hand. As this is an iterative process, I supposed that I would add cuts to master problem and reoptimize it until converging. However, after calling 'addVar', SCIP return with an error 'SCIP: method cannot be called at this time in solution process!'. So I suppose that SCIP may not support remodifying its Model after solving?
I understand that SCIP have supports for doing benders decomposition through initBendersDefault. But since my idea is to combine branch and price with benders decomposition(MP: branch and price, SP: column generation), the variables are not fully known so explicit use seems hard. Thus I dicided to handle this by hand. Do you think this idea is feasible within PyscipOpt or can you possibly provide some examples to utilize Benders Decomposition interfaces like SCIP official documentation? Thank you!
My idea actually comes from this paper

The Recoverable Robust Tail Assignment Problem(2014)

Hi
I guess @stephenjmaher is the right person to ask about your Benders application and how to use it. In tests/test_benders.py there is a test, that I guess is more of an example, which can be used as an example I guess.
Anyway, to add a variable you have to free the transformed problem before, model.freeTransform(). Afterward, you can modify the model however you want.

Thanks again for all your kindness, I used freeProb instead of freeTransform before. While it was eligible to add constraints/variables, I found many detailed problem for resolving Master problem (branch and price). So using the interface may be a better option. I mentioned the new example beforehand because I wanna to use Magnanti-Wong method for improvement and may need to define customized pareto-optimal cuts form, which is not covered in the example.

Hello,
what is the progress on implementing own branching rules in python? Have the updates been made to the master?

yes, it should be possible. have a look at test_branch_probing_lp for an idea on how to implement one.
If you are missing some more functions from the SCIP C-API, you can either add them yourself or let us know

I have a problem with installing the new master:
I downloaded the master and ran the setup. Afterwards the test instances give the error 'pyscipopt.scip.Model' object has no attribute 'chgVarLbGlobal'. However chgVarLbGlobal is defined in the scip.pyx file.
What am I missing?

I have no idea, does anything else fails?

@fserra: Thank you very much for your quick replies!
I could solve the problem: The setup did not rewrite all files. I had to delete them manually before running the setup again.

Thanks for your kindness! @stephenjmaher. So is there any available existing python codes for customized Benders Decomposition? As I am not sure there's a one-to-one correspondence in necessary functions(name, usage) between C++ and Python.

@andynuaa Unfortunately there are no examples for a custom Benders' decomposition in python or C at this stage.
The names that I gave in https://github.com/SCIP-Interfaces/PySCIPOpt/issues/194#issuecomment-438196501 are the method names for the Benders' decomposition python class.
Similar to the way that you created your Pricer and Branchrule, you need to define a BendersXyz class with the appropriate class methods implemented (as I described previously). Then with your BendersXyz class call includeBenders when building your model.

@fserra Hi, fserra. I am wondering if I can resolve a transformed model with variables generated in pricer plugin. The actual motivation for such demand is that I want to apply benders decomposition and add cuts to the solved model (with priced variables generated in the previous iteration) because Pyscipopt seems to have some inconvenience in applying customized benders cuts.  While the existing freeTransformed function will free all the variables generated during solving and leave only the original problem, I am wondering if there is such method enable me to solve the transformed models directly.

The best way to achieve what you are trying is to store all variables that you generate. Then when you free the transformed problem, you can add the previously generated variables upon resolving the master problem.
The method that I use for this is to add the variables generated in previous solves to the master problem during the first call to the farkas and redcost functions of your pricer.

You also make a good point, that it is not currently possible to write a custom Benders' cut plugin. This is something that should be updated in the next release.

@stephenjmaher Thank you for the reply! Then I guess I need to store the constraint coefficients and objective values as well if there are some side constraints other than set partition constraints. I can't wait to see the next release!

@andynuaa If custom Benders' cut plugins are something that you need and are willing to test out, I could put together the necessary classes for this in the next couple of weeks.

@stephenjmaher Sure, I'd love to, thank you Maher!

@andynuaa If custom Benders' cut plugins are something that you need and are willing to test out, I could put together the necessary classes for this in the next couple of weeks.

Sure, I'd love to, thank you!

All discussion related to custom Benders' decomposition cuts in PySCIPOpt has been moved to https://github.com/SCIP-Interfaces/PySCIPOpt/issues/263


fix: fix multiprocessing bug in pso solver

In the project code, Particle_swarm_optimization_solver may have a code error.
Specifically, this issue occurs when using multiprocessing for parallel processing in the solution method. In Python, when using multiprocessing, passing an object directly as a parameter can cause some issues:
When a new process is created, the parameters are serialized (pickled) and then passed to the child process. The child process receives a completely independent copy of the parameter object.
Any modifications made to this copy by the child process will not affect the original object in the main process because they are in different memory spaces.
As a result, during each evolve iteration, the particle's properties, such as node_slots, will not be modified. This implementation may have some issues.

Good Job! Thank you for the corrections.


Update the readme

@timfrijtersppw Also add docs for using this as a package: @ppwcode/angular-schematics


attributeOverride on mappedSpuerclass YamlDriver

This allows the use of attributeOverride on a mappedSpuerclass yaml format.
Without this you have exception
[Doctrine\ORM\Mapping\MappingException] Invalid field override named 'field' for class 'Acme\DemoBundle\Entity\Custom'
replace of https://github.com/doctrine/doctrine2/pull/1477 beacause of wrong branch.

Same as #1479 - needs to be correctly rebased.
Closing for now, but:

tests are required
only bigfoot90/doctrine2@e3e6976 should be in this branch


Fix -s flag printing empty lines

This should fix the empty lines being printed when using the -s flag.

Nice fix @FalcoXYZ 👍🏻


Use .Xr instead of .Cm to reference another manual

Thanks!

@bdrewery Thank you too for maintaining this important tool!


[BUG]: Save for reuse not working in transform dataset

Scenario: https://github.com/DARPA-ASKEM/terarium/blob/main/testing/manual/transform-dataset.md
Step: 3-8
Link to the project: https://app.staging.terarium.ai/projects/47f6fb2b-9a7b-4269-85a4-300ee1eb5437/workflow/8834d9e5-5ac6-409a-be36-8175f1b60057?operator=55b17fce-df46-4bbb-8629-dbef93aab74a

Describe the issue

Save for reuse button is not working and there's no way to save the updated/created dataset as new dataset.

Fixed in https://github.com/DARPA-ASKEM/terarium/pull/5412


[BUG][V1.7.0][Longhornctl] Longhorn CLI fail on check preflight on PXE booted nodes

Describe the bug
emeric@node:~$ ./longhornctl check preflight --kube-config ~/.kube/config
INFO[2024-08-25T13:46:53+02:00] Initializing preflight checker
INFO[2024-08-25T13:46:53+02:00] Cleaning up preflight checker
INFO[2024-08-25T13:46:53+02:00] Running preflight checker
ERRO[2024-08-25T13:47:08+02:00] Failed to run preflight checker: failed DaemonSet condition check: pod container is in crash loop. View the logs using "kubectl -n default logs longhorn-preflight-checker-2p2g7 -c init-longhornctl"
emeric@node:~$ kubectl -n default logs longhorn-preflight-checker-2p2g7 -c init-longhornctl
time="2024-08-25T11:47:22Z" level=info msg="Checking iscsid service status"
time="2024-08-25T11:47:22Z" level=info msg="Checking multipathd service status"
time="2024-08-25T11:47:23Z" level=info msg="Checking if NFS4 (either 4.0, 4.1 or 4.2) is supported"
time="2024-08-25T11:47:23Z" level=error msg="Failed to run preflight checker: open /host/boot/config-6.9.11-200.fc40.x86_64: no such file or directory"

So I did try to install longhorn with the kubectl apply method then, longhorn-driver-deployer is stuck and it looks like it's waiting for longhorn-preflight-checker pods that fail.
I don't really now what longhorn-preflight-checker does but the name let me think it's a longhornctl pod ;)
To Reproduce
I did boot my Fedora CoreOS baremetal nodes via PXE/iPXE and provision them via ignition files.
k8s works well as far as I can tell (I'm in early steps of building a volatile kube)
I think that in this configuration, I don't have any /boot/config-6.9.11-200.fc40.x86_64 directory so you can't rely on it
Expected behavior
Preflight check should continue
Environment

Longhorn version: 1.7.0
Installation method (e.g. Rancher Catalog App/Helm/Kubectl): Kubectl
Kubernetes distro (e.g. RKE/K3s/EKS/OpenShift) and version: Kubeadm 1.30.4

Number of control plane nodes in the cluster: 1
Number of worker nodes in the cluster: 3

Node config

OS type and version: Fedora CoreOS 40
Kernel version: 6.9.11-200.fc40

Underlying Infrastructure (e.g. on AWS/GCE, EKS/GKE, VMWare/KVM, Baremetal): Baremetal

Additional context

Workaround and Mitigation

@Nemric
Thanks for reporting the issue. We will improve the compatibility issue. You could fall back to environment_check.sh instead.

Thanks @derekbit :)
The biggest concern is in the longhorn-driver-deployer installation process that seems to rely on longhorn-preflight-checker that seems to use longhornctl
So, how could I move to environment_check.sh while using kubectl apply ....

@Nemric You can check https://longhorn.io/docs/1.7.0/deploy/install/#using-the-environment-check-script. :)

Hi, I did try this script and ... I had to tweak it :
As in this line : path to kernel config is hard coded, not a problem for many distrib but for CoreOS it is
I did found this path that did the trick : /lib/modules/${kernel}/config
Another thing, CoreOS do not use nfs-utils but nfs-utils-coreos because of python (that is not shipped) dependency I think
nfs-utils : NFS utilities and supporting clients and daemons for the kernel NFS server
nfs-utils-coreos : Minimal NFS utilities for supporting clients

I think that when checking OS you should check for VARIANT_ID in /etc/os-release because CoreOS is rpm-ostree based and won't really works as fedora sever
Thanks for reading :)

Thanks @Nemric. The environement_check.sh doesn't support all OSes in the market. We usually improve it when there is feedback from users. We will improve the flight check CLI according to your suggestion.
Currently, you can install and validate the requirements mentioned in https://longhorn.io/docs/1.7.0/deploy/install/. Sorry for the inconvenience.

:/ I don't know what was changed but the installation of v1.7.1 did run as expected
I did upgrade K8S and Cri-O to v1.31.0 and did give another try to Longhorn and everything works great now
I don't know if I have to close the issue as I can see 2 questions :

It seems that the longhorn-preflight-checker didn't block installation any more and perhaps have an "assume-clean" default behavior
longhorn-preflight-checker perhaps still need to support some container optimised distribs like CoreOS or Flatcar or else


Update scala-parallel-collections to 1.0.0

Updates org.scala-lang.modules:scala-parallel-collections from 0.2.0 to 1.0.0.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.scala-lang.modules", artifactId = "scala-parallel-collections" } ]

labels: library-update, semver-major

Superseded by #43.


Android12

Android12合并新包成功，但是新包md5不一致

Android12合并新包成功，但是新包md5不一致

Can you please share more information on this issue ?
Does CorePatch work on Android12 ? Have you found the solution ?


GH-37254: [Python] Parametrize all pickling tests to use both the pickle and cloudpickle modules

Rationale for this change
Cloudpickle was not tested in most parts of the pyarrow test suite. Improving this coverage will make the Cython 3.0.0 upgrade cleaner as cloudpickle was failing in a few places where the default pickle module was not. This has been verified using Cython 0.29.36.
What changes are included in this PR?

__reduce__ methods that need to pass kwargs have been changed from classmethod to staticmethod
All pytests that pickle objects are parameterized to use both pickle and cloudpickle

Are these changes tested?
Yes, pytests run successfully with Cython 0.29.36
Are there any user-facing changes?
No.

Closes: #37254

Cython 3 will set binding=True by default for the compiler. With Cython 0.29.36, we just need to add the binding=True compiler option to make it backwards compatible. Here's a small repro as an example:
my_test.pyx
# cython : language_level = 3
import cython

cdef class Foo():
    @staticmethod
    @cython.binding(True)  # This works
    def _reconstruct():
        return Foo()

    def __reduce__(self):
        return Foo._reconstruct, tuple()

@staticmethod
def _reconstruct(x):
    return Bar(x)

cdef class Bar():
    @staticmethod  # This does not work
    def _reconstruct():
        return Bar()

    def __reduce__(self):
        return Bar._reconstruct, tuple()

Usage here:
In [1]: from my_test import Foo, Bar

In [2]: f = Foo()

In [3]: b = Bar()

In [4]: import pickle

In [5]: pickle.dumps(f)
Out[5]: b'\x80\x04\x95#\x00\x00\x00\x00\x00\x00\x00\x8c\x07my_test\x94\x8c\x10Foo._reconstruct\x94\x93\x94)R\x94.'

E   OSError: When creating bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 503) during HeadBucket operation: No response body.

For the intermittent failure, I've also seen it in the CI tests for https://github.com/apache/arrow/pull/37097. The 503 error means "Service unavailable". Seeing as this is a session-scoped pytest fixture and it only is failing on the very first invocation so far, I'm pretty sure that minio is just not fully started yet when the pytest tries to call the server after starting it. We can introduce pytest_xprocess to better manage processes as fixtures. I'll add that to this PR. https://pytest-xprocess.readthedocs.io/en/latest/

For the intermittent failure, I've also seen it in the CI tests for #37097. The 503 error means "Service unavailable". Seeing as this is a session-scoped pytest fixture and it only is failing on the very first invocation so far, I'm pretty sure that minio is just not fully started yet when the pytest tries to call the server after starting it the first time. We can introduce pytest_xprocess to better manage processes as fixtures. I'll add that to this PR. https://pytest-xprocess.readthedocs.io/en/latest/

xprocess doesn't quite fit cleanly into what we want. I tried adding a connection_timeout parameter to s3fs in our tests instead to see if that helps.

@github-actions crossbow submit python

@github-actions crossbow submit python

@github-actions crossbow submit test-conda-python-3.11-hypothesis

Still need to fix the intermittent failure with minio server startup.

@github-actions crossbow submit python

@github-actions crossbow submit python

CI looks good! No S3 intermittent failures reported after 2 full runs. All current failures are unrelated.
Ready to merge IMO.

Nice, thanks a lot Dane!


fix initialization of BatchNormalization

Currently the scaling parameter gamma is uniformly sampled between
-0.05 and 0.05. This also brings the std -0.05 and 0.05 and not to
1 as claimed by the docstring of the BatchNormalization class.
This commit fixes it by initializing gamma to 1.  The same
initialization is used by
(lasagne)[http://lasagne.readthedocs.org/en/latest/modules/layers/normalization.html#lasagne.layers.BatchNormLayer]

That seems reasonable. Merged, thanks!


Add anyhow-integration feature which implements Fromanyhow::Error for PyErr

This makes it possible to use anyhow with pyo3. Includes documentation for feature in guide.

IMO it's fine to use RuntimeError since using anyhow usually means the developer don't care about the exact error type.

I tend to agree with @messense, this is a nice convenience feature for application code.
For library code, many Python libraries make their own exception class or hierarchy and convert upstream exceptions to those. This is obviously not possible to offer from PyO3 and needs some converter functions in the respective library.
I'm not sure about the formatting, though: is {:?} the correct one?  (anyhow::Error also can have context information; this should not be discarded if possible.)

Of course, it's also possible to provide, under the same feature, a method on PyErr for converting anyhow::Error into arbitrary exception classes if wanted.

Thanks!
Would you be willing to add an entry and doc example here?

my stance at the moment is that I'd like to be persuaded this is necessary.

I think this is also how I feel.
I also think it is inconsistent that eyre has this conversion there and that we'd have anyhows here. But that isn't necessarily a problem to me.

I'm not sure about the formatting, though: is {:?} the correct one? (anyhow::Error also can have context information; this should not be discarded if possible.)

From my testing, the context is correctly preserved :)

Thanks!
Would you be willing to add an entry and doc example here?

I assume this was directed at me :) in which case will do!

my stance at the moment is that I'd like to be persuaded this is necessary.

I think this is also how I feel.
I also think it is inconsistent that eyre has this conversion there and that we'd have anyhows here. But that isn't necessarily a problem to me.

I did think about submitting this change to anyhow instead. But, there are only a handful of popular error handling crates. Contrast that to the bazillion possible crates you may want to use in an application. I feel like it would be asking too much to add support for all those crates into the error handler ones.

I think that is everything.

Thank you @mejrs and @davidhewitt so much for finishing this up :). I appreciate it!


Consider the switch from kind to k3d

We already made some experiments with k3d which looked very good in terms of speed and performance, the only visible blocker was inability to have the test on the same network as in
https://github.com/rancher/k3d/issues/111
Looks like the issue is solved in recent k3d version and we might give it another shot as we definitely want faster test cycle both locally and within ci/cd pipelines

time k3d cluster create k3d-TEST

real    0m22.658s
user    0m2.139s
sys     0m1.791s

time kind create cluster --name=kind-TEST

real    0m35.984s
user    0m1.551s
sys     0m1.133s

Apparently it is not so critical deviation to worth a switch

@kuritka do you have node images cached? would be nice to see results if node image is not downloaded

Thx for comments, maybe more relevant statistic:

time kind create cluster --name=test-kind --config=deploy/kind/cluster.yaml
real    2m25.964s
user    0m4.373s
sys     0m3.168s

delete and run again
time kind create cluster --name=test-kind --config=deploy/kind/cluster.yaml
real    1m8.060s
user    0m4.774s
sys     0m3.098s

delete and run again
time kind create cluster --name=single-kind
real    0m23.073s
user    0m1.254s
sys     0m0.765s

prune all containers and images <<

time k3d cluster create multiserver --servers 3
real    1m25.317s
user    0m6.233s
sys     0m5.023s

time k3d cluster create multiserver --servers 3
real    0m43.637s
user    0m3.724s
sys     0m2.967s

delete and run singleserver !!!!!
time k3d cluster create single1
real    0m11.381s
user    0m1.136s
sys     0m0.907s
time k3d cluster create single2
real    0m11.381s
user    0m1.136s
sys     0m0.907s

I'd say k3d is twice faster, but since gitub action runner (public) contains kind already, result might be different


Thumbnail upload fixes

PR Checklist

Please check all that apply to this PR using "x":

[X] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
[ ] I have checked that this PR does not introduce a breaking change
[ ] This PR introduces breaking changes and I have provided a detailed explanation below

PR Type
What kind of change does this PR introduce?

[X] Bugfix
[X] Feature
[X] Code style update (formatting)
[X] Refactoring (no functional changes)
[ ] Documentation changes
[ ] Other - Please describe:

Fixes
Issue Number: Closes #6082, closes #6098, closes #6097
Just reduced some redundant code and improved overall formatting

Thanks for this!
It looks good for the thumbnail upload, but this broke the URL feature on the channel page. Can't click Done when adding via URL.

-made it so the modal remembers the current url value, in case of wanting to edit or erase (currently the form is just reset)
-now I think it closes #6097 :

@tzarebczan Done!

Looks like it's failing - I also tried to rebase on master and it was giving me conflicts.

@tzarebczan try it now, seems to work for me

Got to take another close look at this and I think something broke with the pending thumbnails - it would used to show a message that say "your image will show in a few minutes" or something like that. Now it has the red x since the image can't be called via the CDN until after it's confirmed.
It would be nice if it put the image into the placeholders and then kept it around with the state, or it can just leave that old message. But the red X is bad. My profile was an already uploaded image, so that worked.

@tzarebczan fixed it now!
The error was supposed to be shown when an invalid URL is given:

Now it shows back the correct delay message after submitting and unconfirmed by the CDN:

Moved to https://github.com/lbryio/lbry-desktop/pull/6860


Fixing UI for CSV Compatibility

Results from CSV files can now be plotted and explored.
Results are minimized by default, ordered by OI-Ratio; no sort panel.
Results are color coded based on severity (hardcoded thresholds).

Coverage decreased (-1.08%) to 93.102% when pulling abdd6c2506a9007756e7088956f53ad61006b58e on csv_plot_debug into 97c87776ffed0baf14d9bd4f051eb733dee27924 on master.

Coverage decreased (-1.08%) to 93.102% when pulling a0b27ebcc113c0baf734335de9f40d6d8f0b2074 on csv_plot_debug into 97c87776ffed0baf14d9bd4f051eb733dee27924 on master.

Coverage decreased (-0.1%) to 94.034% when pulling 7458d0d02697d36b8d1e0dff649974d072e4ca79 on csv_plot_debug into 97c87776ffed0baf14d9bd4f051eb733dee27924 on master.

Coverage decreased (-0.1%) to 94.034% when pulling 02f131fa2dc4abb821904ff9b5078bd37764732a on csv_plot_debug into 3b2eb5807a899dd3b630692168348f28288d0a7f on master.

Changes Unknown when pulling 13e692fc0bc83bb3c0302a4777f92248894fe4e2 on csv_plot_debug into ** on master**.


Running a cell results in "guidance_rescale" error

I have a problem when running the cell called "Run this cell to generate images". When it comes to reaching that cell, it gives me the following error:

I have to say that the notebook worked for me the first time, but when I deleted the environment and did it again from scratch for the second time, it started giving me this error.
And yes, I have disconnected and deleted the environment.
I have also verified if the notebook link is the same as the one in this Github and it is the same, without changes or anything.

My bad, I made an update but tested it only on SDXL pipeline. Error should be fixed now.

Perfect, it works now!. Thank you!


Defect created on Github

This issue comes from GH baby!

Open Defect in TestQuality

Test A test with steps from the begining in Run Run 550 (linked to Cycle All tests).


Compose Shape as Particle Shape

Looking through the code of compose KonfettiView gived me answer that this should be easily implemented

class GenericShape(
val shape: androidx.compose.ui.graphics.Shape
) : Shape
Like this

Maybe i will start PR


Create report json

Android team is parsing resulted from html which isn't developer-friendly. We should improve it with a JSON file for parse. Later HTML report UI will be generating based on report.json or you can skip a UI step completely. Some improvements across code. Added some debug info.

@winner95 Can you also have a look? it looks fine from my side.

@winner95 Can you also have a look? it looks fine from my side.

@langolf  thank you for your contribution!
@NikhilVerma looks good to me.

@langolf  thank you for your contribution!
@NikhilVerma looks good to me.


Correction in alignment of feature post

This is the current situation , where the misalignment is clearly visible

I suggest a better alignment for the feature post section in leading blog page
An alignment like the one below would be more suitable

current one works too

The current one does work but a proper alignment looks better


emacs-snippets to ~/.doom.d/snippets: Workaround issues

Originally posted by @hlissner in https://github.com/hlissner/doom-emacs/issues/812#issuecomment-414508317:
2. Clone https://github.com/hlissner/emacs-snippets to `~/.doom.d/snippets`
3. Run `~/.emacs.d/bin/doom refresh` (or `make` in `~/.emacs.d`)

When I tried this I get on OS Windows a warning:
>git clone https://github.com/hlissner/emacs-snippets  snippets
Cloning into 'snippets'...
[…]
Checking out files: 100% (2555/2555), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'org-mode/struct_C'
  'org-mode/struct_c'
  'org-mode/struct_E'
  'org-mode/struct_e'

I recommend a renaming like.
  'org-mode/struct_c_shifted'
  'org-mode/struct_c'
  'org-mode/struct_e_shifted'
  'org-mode/struct_e'

It seems to be a emacs convention to use lowercases first.
That is the reason, why only uppercases get renamed here.

This should've been reported in the emacs-snippets repo. That said, I've addressed it there by renaming these templates (hlissner/emacs-snippets@2c3b11e). Thanks for letting me know!


passing forks to join in tests throws error

I have a saga I am writing tests for. Here is my saga:
export function * retrieverFetchSaga ({payload:{genes, query}}) {
try {
    const schemaTasks = yield getRequiredSchemaNames(config.fetch).map(modelName => fork(fetchSchema, modelName))
    const geneResp = yield call(fetchQuery, 'gene', {docid__in: deduplicate(genes.sort())}) // deduplicate any values
    const resps = yield getRelatedModels(geneResp, config.fetch.relatedModels, true)
    const schemas = yield schemaTasks.map(task => join(task))
...
}

and here is my test:
describe('retrieverFetchSaga', () => {
  it('runs correctly', () => {
    const action = {payload: {genes: ['BRCA1', 'BRCA2', 'BRCA2', 'BRCA3'], query: 'commercial'}}
    const fakeGeneResp = {}
    const fakeRelatedResps = [{}, {}]
    const fakeSchemaTasks = [fork(function * () {}), fork(function * () {})]
    const generator = retrieverFetchSaga(action)
    let next
    next = generator.next()
    const expectedSchemaNames = ['gene', 'genereporttext', 'genecommercialtext', 'pubmed']
    expectedSchemaNames.forEach(name => {
      expect(next.value).toContain(fork(fetchSchema, name))
    })
    next = generator.next(fakeSchemaTasks) // This is complaining that the forks aren't valid holding off for now
    expect(next.value).toEqual(call(fetchQuery, 'gene', {docid__in: ['BRCA1', 'BRCA2', 'BRCA3']}))
    generator.next(fakeGeneResp) // this yields responses from getRelatedModels
    next = generator.next()
    expect(next.value).toEqual(fakeSchemaTasks.map(task => join(task)))
  })
})

So the problem is when I run this there is an error thrown:

this happens even if I pass next.value to generator next that we already tested are forks.
So as far as I can tell I can't really test the joining of forks. Please help to figure this out.

join will throw if not provided with a Task object. During execution the middleware creates those objects internally . During tests you can use the createMockTask  helper function to mock fork results
A simple example
import {  fork, join } from 'redux-saga/effects'
import { createMockTask } from 'redux-saga/utils'

function* someGen() { ... }

function* gen() {
  const task = yield fork(someGen)
  yield join(task)
}

describe('gen', () => {
  it('runs correctly', () => {
    let next = gen.next()
    expect(next.value).toEqual(fork(someGen))

    let fakeTask = createMockTask ()
    next = gen.next(fakeTask)  // pass the fake task to the generator
    expect(next.value).toEqual(join(fakeTask))
  })
})

Thanks so much for clarifying -- super helpful. I somehow missed the createMockTests.

Would be nice maybe to put things like createMockTests ins the Docs glossary? I've been looking for something like this and I end up here (and solved my issue, btw) tho I think is not the ideal discovery flow :D

@sospedra
Would you like to provide a PR with this simple change? Would be much appreciated


Is this project dead?

There haven't been any commits for at least two days. Is this project even maintained anymore? Do you need a new maintainer?

Looks like the project is alive and maintained. Closing this issue out. See https://github.com/benaadams/System.Ben/pull/108


PR: Remove CodeEditor instances from LSP client when split editor is closed

Description of Changes
Send textDocument/didClose notification on all codeeditor instances that belong to a split tab that is closed.

[x] Wrote at least one-line docstrings (for any new functions)
[x] Added unit test(s) covering the changes (if testable)

[ ] Included a screenshot or animation (if affecting the UI, see Licecap)

Issue(s) Resolved

Fixes #9341
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:
@andfoy

Thanks for the quick response @andfoy! Any chance of adding a test for this?

@andfoy, thanks for the test! I added some commits to fix some odd issues with it, but otherwise it looks good.
Azure seems to have some problems at the moment, so I'll merge when they pass.

Thanks @ccordoba12!


flatten column menu

redo the column menu to have less hierarchy and move the items around a bit.
entries should be, in order:

Hide Column
Filter...
Search...
Format ->
Sort Ascending
Sort Descending
No Sort
Align Left
Align Center
Align Right
Heatmap
Data Bars
Fix Left
Fix Right

maybe it also makes sense to show shortcuts for Heatmap and Data Bars menu items?

yes, please show the shortcuts


Some operative clauses only allowed in SC resolutions

There will have to be some kind of differentiation between normal and SC resolutions, this may be achieved by requiring an extra key for creating SC resolutions or, if all users enter a personal code, identification of the respective user with their committee.

#4 needs to add the new phrases and which of them are SC exclusive first.


Added Django tutorials

Added Django Girls, Real Python, Tango with Dango tutorials. Passed JSONLint test.

@jonhmchan does this look good to merge? Can I merge it myself? It passed the JSONLint test.


Add a Kotlin language backend

I saw there's Typescript support in the works (is there a tracking issue?). It'd be neat if it could support Kotlin too. There's something similar for Kotlin called SQLDelight, but it only supports sqlite and was built for Android. JVM support for Java/Kotlin would be really cool.
I might be able to contribute if you are open to this.

The first version of this has now landed! I'm going to mark this as complete. I've added a new kotlin label for future issues.


When I accept the Calendar permissions in the Auth it redirects me to a 404 not found from laravel

good morning,
I have this error, I have everything already configured and it works for me until the Google Auth platform tells it to allow calendar permissions, which at that moment redirects me to a Laravel URL that does not exist 404.
Attached photos:

The last URL: https://crm.mobisoft.works/google/oauth?code=4/0AfgeXvvp9qdhQGlGmhBmDLOaZcvb4duDd8kMYm5kxbfQeSzsBSkYb6Ccu1xB3OJxhRnB2w&scope=email https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar openid&authuser=0&hd=mobisoft.works&prompt=consent
Thanks.

Hello,
I have already solved the problem, the error is in the GOOGLE_REDIRECT_URI and GOOGLE_WEBHOOK_URI.
Correct Form:
GOOGLE_REDIRECT_URI="${APP_URL}/public/admin/google/oauth"
GOOGLE_WEBHOOK_URI="${APP_URL}/public/admin/google/webhook"


[Feature Request] Sync group chat images between the server and client

SMServer, WebMessage, and MyMessage all support this feature. (Idk where the code is in MyMessage's library)

This will be done via server pulling data from the chat.db


Only allowing RDF input for serialization

@cspayne writes:
Given some formats don't use namespaces (e.g. n-triples), serialization from a different format to rdf results in renamed namespaces (n0, n1, n2) and the loss of uw-specific namespaces.
The easiest prevention is to always convert from rdfxml to other serializations - but is this a reasonable ask?
@briesenberg07 comments:
To put it another way, I think, do we want to write code to facilitate using a serialization other than RDF/XML as the 'source file' for outputting updates? Or do we want to require that updates are always made in an RDF/XML file and other serializations created from this?
If we want to allow using other than RDF/XML as source, we'd need an extra processing step to put preferred prefixes in RDF/XML, Turtle, etc. when outputting these.

For now: yes we can limit input to RDF.
(code has been commented out that allows serialization from other formats, in the instance that we end up changing this decision)


client: websockets tests.

What do you think? The error handling tests could be better, consider those placeholders for now. We might want to expose the retry delay so that we can avoid waiting for a long time in the tests. :smile:

Agreed, the following options could be exposed:

reconnectDecay: Rate of increase of the reconnection delay.
maxReconnectAttempts: Max. number of reconnection attempts.
maxReconnectInterval: Max. number of ms for a reconnection.


feat: add confirm and validate dialog component

Issue
https://github.com/gravitee-io/issues/issues/XXXXX
Description

Additional context

Gravitee.io Automatic Deployment
A prerelease version of this package has been published! 🚀
To use it in your project run the following lines:
npm install<EMAIL_ADDRESS># or
yarn add<EMAIL_ADDRESS>

Gravitee.io Automatic Deployment
A prerelease version of this package has been published! 🚀
To use it in your project run the following lines:
npm install<EMAIL_ADDRESS># or
yarn add<EMAIL_ADDRESS>

Gravitee.io Automatic Deployment
A prerelease version of this package has been published! 🚀
To use it in your project run the following lines:
npm install<EMAIL_ADDRESS># or
yarn add<EMAIL_ADDRESS>

Gravitee.io Automatic Deployment
A prerelease version of this package has been published! 🚀
To use it in your project run the following lines:
npm install<EMAIL_ADDRESS># or
yarn add<EMAIL_ADDRESS>

:tada: This PR is included in version 3.13.0 :tada:
The release is available on:

npm package (@latest dist-tag)
npm package (@latest dist-tag)
npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


MotM Spellcasting

Mordenkainen's Monsters of the Multiverse switches up spellcasting quite a bit causing it to not be parsed
The Spellcasting item is found in the Actions section, rather than features, and the description text moves some things around
Spellcasting. The warlock casts one of the following spells, using Charisma as the spellcasting ability (spell save DC 14):

At will: dancing lights, disguise self, mage armor (self only), mage hand, minor illusion, prestidigitation, speak with animals

1/day each: charm person, dimension door, hold monster

Spellcasting. The archdruid casts one of the following spells, using Wisdom as the spellcasting ability (spell save DC 17):

At will: beast sense, entangle, speak with animals

3/day each: animal messenger, dominate beast, faerie fire, tree stride

1/day each: commune with nature (as an action), mass cure wounds

Moving the spellcasting block out to the Features section and changing the name to Innate Spellcasting allows it to parse accurately, so perhaps some use of that logic can be used to capture this as an action. I'm not as familiar with this portion of the code, but I will take a look at it.

This should be fixed after v1.90.1 (with an approach not too different from your PR). Let me know if it works for you.


Support for Xamarin.Forms on Android

We have a use case that requires integration between Auth0 and Xamarin Forms. I have implemented the iOS version per the Xamarin SDK Quickstarts and it is working well. However, I am unable to implement the Android integration using the PageRenderer (see below) technique that is recommended by Xamarin. Guidance in the area would be really helpful.
`public class Auth0LoginPageRenderer : PageRenderer
{
Auth0LoginPage page;
Auth0Client auth0;
	public Auth0LoginPageRenderer()
	{
        var options = new Auth0ClientOptions
        {
            Domain = ApiConfig.Auth0Domain,
            ClientId = ApiConfig.Auth0ClientId,
            Activity = Context as Android.App.Activity
        };
        auth0 = new Auth0Client(options);
	}

    protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
    {
        Console.WriteLine("OnElementChanged: BEGIN");
        base.OnElementChanged(e);
        if (Element == null)
        {
            return;
        }
        page = Element as Auth0LoginPage;
    }

    protected override void OnAttachedToWindow()
    {
        Console.WriteLine("OnAttachedToWindow: BEGIN");
        base.OnAttachedToWindow();
        if (auth0 != null)
        {
            Task.FromResult(Login());
        }
    }

    async Task Login()
    {
		Console.WriteLine("Login: BEGIN");
		try
		{
			var loginResult = await auth0.LoginAsync(null);

			if (loginResult.IsError)
			{
				page.LoginFailed();
				MessagingCenter.Send("Failed", "LoginPageDone");
				Console.WriteLine("User login failed!");
			}
			else
			{
				UserProfile userProfile = new UserProfile();
				userProfile.AccessToken = loginResult.AccessToken;
				userProfile.IdToken = loginResult.IdentityToken;
				userProfile.RefreshToken = loginResult.RefreshToken;
				userProfile.AuthenticationTime = loginResult.AuthenticationTime;
				userProfile.AccessTokenExpiration = loginResult.AccessTokenExpiration;

				page.LoginSuccess(userProfile);
				MessagingCenter.Send("Success", "LoginPageDone");
			}
		}
		catch (TaskCanceledException ex)
		{
			System.Diagnostics.Debug.WriteLine(nameof(Auth0LoginPageRenderer) + nameof(Login) + ": " + ex);
			page.LoginCancelled();
		}
		catch (TaskSchedulerException ex)
		{
			System.Diagnostics.Debug.WriteLine(nameof(Auth0LoginPageRenderer) + nameof(Login) + ": " + ex);
			page.LoginFailed();
		}
	}

}

`

@gitizenme Unfortunately I have no knowledge of Xamarin Forms in order to assist with this at this stage :(
As time allows in the future I can look into this for you if you are unable to find a solution.

I've gone another direction on this and am now using the Xamarin Dependency Service. I'm able to get through the login process up the point where the Android method
		protected override async void OnNewIntent(Intent intent)
should be called on upon completion of the Auth0 login through Chrome. I've set a debug breakpoint in this method and it is not getting called.
Any guidance?

Okay, I'm stuck with an exception being generated from the Auth0Client constructor:
System.NullReferenceException: Object reference not set to an instance of an object.   at Auth0.OidcClient.Auth0Client..ctor (Auth0.OidcClient.Auth0ClientOptions options) [0x00029] in <e5a765d3d03346a78f40e6ec304e7fac>:0   at BCXMobile.Droid.Auth0LoginImplemenation+<LoginAsync>d__7.MoveNext () [0x0001d] in /Users/joe/Projects/Convergence/Dev/projects/BCX/projects/mobile/BCX-Mobile/Droid/Auth0LoginImplemenation.cs:44
with a call:
            client = new Auth0Client(new Auth0ClientOptions             {                 Domain = "FOOBAR.auth0.com",                 ClientId = "BASH",                 Activity = this             });
Any chance I can grab the  source code for the client?

Yes, sure. Source code is over here:
https://github.com/auth0/auth0-oidc-client-net

@gitizenme Did you manage to get this one sorted?

No, we have a use case where we need to pass extra parameters to the underlying OIDC implementation that are not exposed in the Auth0 implementation.

Can you please expand?
Do you need to pass parameters to Auth0? If so you can see an example of that over here:
https://auth0.github.io/auth0-oidc-client-net/documentation/advanced-scenarios/api-authorization.html

@gitizenme On this line, can you check that the Activity reference doesn't end up null after the as cast?
Activity = Context as Android.App.Activity
I also keep having problems.  I'm interested in how you end up solving this.

@gitizenme Are you still interested in Xamarin Forms support? I have something ready, and would like someone to play around with it

Yes, what are the details?
--
Joe Chavez
From: Jerrie Pelser notifications<EMAIL_ADDRESS>Reply: auth0-community/auth0-xamarin-oidc-samples reply<EMAIL_ADDRESS>Date: April 11, 2018 at 5:17:25 AM
To: auth0-community/auth0-xamarin-oidc-samples auth0-xamarin-oidc-samples<EMAIL_ADDRESS>CC: Joe Chavez joe@izen.me(mailto:joe@izen.me), Mention mention<EMAIL_ADDRESS>Subject: Re: [auth0-community/auth0-xamarin-oidc-samples] Support for Xamarin.Forms on Android (#6)

@gitizenme(https://github.com/gitizenme) Are you still interested in Xamarin Forms support? I have something ready, and would like someone to play around with it
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub(https://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-380431153), or mute the thread(https://github.com/notifications/unsubscribe-auth/AAnRsOYhuSP4E8QUQSzCFEixIzZDdGlCks5tnfRVgaJpZM4OewL4).

@gitizenme
I have created a feed on MyGet with the beta packages:
https://www.myget.org/F/auth0-oidcclient/api/v3/index.json
Please be sure to add this feed to your NuGet sources, so you can install packages from there.
Also, here is sample demonstrating how to use it:
https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/XamarinForms/Samples/XamarinForms/FormsSample
That particular sample uses a shared project, but if you create seperate PCL or .NET Standard assembly for your Xamarin Forms, then this version includes a new package called Auth0.OidcClient.Core. This contains an IAuth0Client interface which you can use in your Forms assembly.
In that case you will also have to use Dependency Injection to inject the correct platform-specific instance.
Docs are a bit sparse at this stage, so feel free to ping me in you have any uncertainty. I would like to understand you use-case, so I can be sure we cater for as many scenarios as possible.

Hi and thanks in advance. I'm also very interested in Xamarin.Forms support for both Android and iOS. Is Auth0.Oidclient.Core reliable? A plan to publish it on "regular" nuget?

@andrekiba Yes, the plan is definitely to release it on NuGet. But I need to get feedback from actual developers using this beta. So if you can check it out and give me feedback, it will be very helpful

for iOS the only thing I need to do (apart calling LoginAsync) is add the URL type inside Info.plist?
Yes

In Android I still need to manage intent filers and OnNewIntent inside the MainActivity?

Yes. Please also ensure to set the LaunchMode for the activity to SingleTask. See https://github.com/auth0-community/auth0-xamarin-oidc-samples/blob/XamarinForms/Samples/XamarinForms/FormsSample/Droid/MainActivity.cs#L13-L20

Hi @jerriep, the Auth0.Oidclient.Core seems to work correctly. I have a question: is there a way to retrieve user_metadata?  In Auth0ClientOptions I have "openid profile email".

@jerriep Xamarin noob here. Could you please provide a .net standard example?

@jerriep I asked too soon. This noob finally figured it out. Whether or not this is considered a correct way of doing it, I created an IAuth0ClientFactory interface on the main project side. Then created a platform specific classes that implement the interface and create an Auth0Client. I still think an example project provided by Auth0 might help out some people.

Yes, the correct way is to reference IAuth0Client in your view model, and then instantiate and inject the correct implementation on each platform.
One of the reasons I have not done a sample like this is because I was not sure which dependency injection framework is the most common on Xamarin Forms and makes the most sense.
Which DI framework did you use?

I used DependencyService from Xamarin.Forms. I'm not sure what is most common, but for someone starting out this is what I found first.

Thanks @sdkraemer , I will add it to my to-do list to create a .NET Standard sample for Xamarin Forms.

Hey man, first of all, I'd like to really thank you for making this as it makes my life a million times easier.
Secondly, I'd like to ask if I'm using it correctly (lol). So I'm also using a project that uses the .Net Standard assembly in Xamarin.Form, and have added the Auth0.OidcClient.Core to the main project. Then I'll be using Dependency Injection based on the IAuth0Client interface for the platform specific implementation.
My question comes in here, do I want to implement those platform specific implementations myself, or should I be adding the nuget package for each platform respectively (Auth0.OidcClient.Andoird/iOS) and then the platform specific "implementations" would be me just returning the classes provided by the nuget packages.
Thanks again for the work you've done, and for your help!

@lcm98 Yes, as you said, the main Xamarin Forms project should reference the Auth0.OidcClient.Core NuGet package and use IAuth0Client interface.
For each platform, you reference platform specific NuGet package (Auth0.OidcClient.Andoird/iOS)  and set up your DI to inject an instance of the Auth0Client for that platform which is found in the relevant NuGet package.
The code to create a platform specific instance is as follows:
new Auth0Client(new Auth0ClientOptions
{
    Domain = "your_auth0_domain", // e.g. abc.auth0.com
    ClientId = "your_client_id"
});

How you inject that instance will depend on the DI framework you are using

Perfect, thanks again!

I'm getting this same error as OP! Android was working fine until I updated my NuGet to 2.0.0. Now there is no longer the Activity parameter in Auth0ClientOptions. I removed the parameter. But Now I am getting this NullReference Exception after defining my Auth0Client. Did anyone resolve this issue?

Can you supply some sort of stack trace or, preferably, as sample project demonstrating the problem?

Jerrie,
Not sure how exactly to provide you with a stack trace without writing a bunch of logs in my code. Which would be about as helpful as my debugging attempts as the nullreference error happens in external code (constructor of Auth0Client).
The project is much to big to provide to you, I don't exactly have the time to prepare a sample project right now, but when I do have the time I will put one together for you.
For now I rolled back my packages to 1.2.0 as I know that works using the Activity parameter.
Do you have any knowledge of the reason for this (and the corresponding controller parameter for iOS) was removed? Is it possible that not having this is the cause of the error? But then why would this not happen on iOS when I removed the Controller parameter?
I seam to be having a similar problem as the one posted here, yet He was using the old version (which works for me). https://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6
Thanks,

Joshua Tanton
Mobile and Web Developer
Flynn Group of Companies
C:+1.416.994.3012
<EMAIL_ADDRESS>https://flynncompanies.com
From: Jerrie Pelser<EMAIL_ADDRESS>Sent: Tuesday, June 19, 2018 11:21:32 AM
To: auth0-community/auth0-xamarin-oidc-samples
Cc: Joshua Tanton; Comment
Subject: Re: [auth0-community/auth0-xamarin-oidc-samples] Support for Xamarin.Forms on Android (#6)
Can you supply some sort of stack trace or, preferably, as sample project demonstrating the problem?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-398438600, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfEe1J-x9ncw2cPJY0qkmnEpan_0YThiks5t-Rb8gaJpZM4OewL4.

@joshuatantonflynn I understand your difficulty. Though, please understand that it is also difficult for me to track the issue down without some reliable way to reproduce it.

Can you please send me the section of code where you create the instance of Auth0Client ?

When configuring the Auth0Client, I need to determine the package name of your Android package. This is what I used the Activity property for previously. In the new version I determine the package name using the following line of code:

string packageName = Android.App.Application.Context.PackageName;

It is possible that that is the offending line of code which results in the NullReferenceException. Can you please execute that line in your own code and let me know the result? Does it return a value? Or does it throw an exception?

Jerrie,
As far as I'm aware I follow the documentation here exactly: https://auth0.com/docs/quickstart/native/xamarin/01-login
I don't see any string packageName set in the docs. Where is that string used.
These are my following relevant code snippets:
Activity declaration:
[Activity(Label = "Flynn Coaching",
          Theme =<EMAIL_ADDRESS>          Icon = "@drawable/Icon",
          LaunchMode = LaunchMode.SingleTask)]

#if DEBUG
[IntentFilter(
new[] { Intent.ActionView },
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataScheme = "com.flynncompanies.coachingandroid",
DataHost = "flynn.auth0.com",
DataPathPrefix = "/android/com.flynncompanies.coachingandroid/callback")]
#else
[IntentFilter(
new[] { Intent.ActionView },
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataScheme = "com.flynncompanies.coachingandroid.prod",
DataHost = "flynn.auth0.com",
DataPathPrefix = "/android/com.flynncompanies.coachingandroid.prod/callback")]
#endif
as you can see I have two sets depending on DEBUG or RELEASE. Both fail with 2.0.0
Auth0Client Declaration (inside onCreate method, global variable to the LaunchActivity):
client = new Auth0Client(
new Auth0ClientOptions
{
Domain = ConstantsData.Auth0Domain,
ClientId = ConstantsData.Auth0ClientId
}
);
You should note that I've kept my ClientId out of this email for security purposes. I assure you it is correct as the same id works with iOS and on droid with 1.2.0. I also have different ClientIds for PROD and DEV as they have different package names. Only difference from docs I've noticed is that in the docs client is declared as a var, while in my code it's declared as an Auth0Client, exact declaration is:
Auth0Cient client;
Finally, launching the login:
With 1.2.0 I use:
authorizeState = await client.PrepareLoginAsync();
var uri = Android.Net.Uri.Parse("googlechrome://navigate?url=" + authorizeState.StartUrl);
var intent = new Intent(Intent.ActionView, uri);
intent.AddFlags(ActivityFlags.NoHistory);
        StartActivity(intent);

I've tried this and
var loginResult = await client.LoginAsync();
with 2.0.0. However since the app crashed long before this code was excuted I don't think this is relevant.
Finally I just noticed in the docs after scrolling down a bit they tell you to do it slightly differently with android.
var loginResult = await client.ProcessResponseAsync(intent.DataString, authorizeState);
But as I said this code is never executed and clearly not the source of my problem.
Thanks,
[https://cdn2.auth0.com/docs/media/social-media/fb-card.png]https://auth0.com/docs/quickstart/native/xamarin/01-login
Auth0 Xamarin SDK Quickstarts: Loginhttps://auth0.com/docs/quickstart/native/xamarin/01-login
auth0.com
This tutorial will show you how to use the Auth0 Xamarin SDK to add authentication and authorization to your mobile app.

Joshua Tanton
Mobile and Web Developer
Flynn Group of Companies
C:+1.416.994.3012
<EMAIL_ADDRESS>https://flynncompanies.com
From: Jerrie Pelser<EMAIL_ADDRESS>Sent: Tuesday, June 19, 2018 8:56:32 PM
To: auth0-community/auth0-xamarin-oidc-samples
Cc: Joshua Tanton; Mention
Subject: Re: [auth0-community/auth0-xamarin-oidc-samples] Support for Xamarin.Forms on Android (#6)
@joshuatantonflynnhttps://github.com/joshuatantonflynn I understand your difficulty. Though, please understand that it is also difficult for me to track the issue down without some reliable way to reproduce it.

Can you please send me the section of code where you create the instance of Auth0Client ?

When configuring the Auth0Client, I need to determine the package name of your Android package. This is what I used the Activity property for previously. In the new version I determine the package name using the following line of code:

string packageName = Android.App.Application.Context.PackageName;
It is possible that that is the offending line of code which results in the NullReferenceException. Can you please execute that line in your own code and let me know the result? Does it return a value? Or does it throw an exception?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-398590597, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfEe1G2C7mLqCRoTd20aS_1u60XtAFw4ks5t-Z3AgaJpZM4OewL4.

The line
string packageName = Android.App.Application.Context.PackageName;

is not mentioned in the documentation, because it is not something you need to do. As I stated, it is executed in the constructor of the Auth0Client and as far as I can see, it can be the cause of the NullReferenceException.
But I need you to confirm that for me.
So can you please execute that line in your code and let me know what the result is?

Hi Jerrie,
I understand now what you mean. Sorry for my confusion. I executed that line prior to where I initiate the Auth0Client. It successfully returned my package name.
Thanks,

Joshua Tanton
Mobile and Web Developer
Flynn Group of Companies
C:+1.416.994.3012
<EMAIL_ADDRESS>https://flynncompanies.com
From: Jerrie Pelser<EMAIL_ADDRESS>Sent: Wednesday, June 20, 2018 7:35:12 PM
To: auth0-community/auth0-xamarin-oidc-samples
Cc: Joshua Tanton; Mention
Subject: Re: [auth0-community/auth0-xamarin-oidc-samples] Support for Xamarin.Forms on Android (#6)
The line
string packageName = Android.App.Application.Context.PackageName;
is not mentioned in the documentation, because it is not something you need to do. As I stated, it is executed in the constructor of the Auth0Client and as far as I can see, it can be the cause of the NullReferenceException.
But I need you to confirm that for me.
So can you please execute that line in your code and let me know what the result is?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-398929974, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfEe1I0nC4oOSjeVlLCgLodmSplo0u7jks5t-twwgaJpZM4OewL4.

Very interesting... and disappointing ;) I sorta hoped that was the issue.
I'll keep looking into it, but I also want to ask you if you can find time to try and create a sample for me which demonstrates this issue. Unless I have some reliable way to reproduce this, I am just making guesses about possible causes.
BTW, when you call
client = new Auth0Client( new Auth0ClientOptions { Domain = ConstantsData.Auth0Domain, ClientId = ConstantsData.Auth0ClientId } );

Does ConstantsData.Auth0Domain and ConstantsData.Auth0ClientId have values? Are one of them not perhaps null?

Hi Jerrie,
I thought you might ask that, that's why I mentioned in my previous emails that they do work for iOS and with 1.2.0 Nuget on droid. Two sets, one for prod, one for dev. But they are definitely set properly.
I have a deadline for this application so I'm focused on reaching that target and will look into 2.0.0 for the next one, since I have it stable with 1.2.0. At that point I can put together a sample project for, maybe some time next week.
Thanks,

Joshua Tanton
Mobile and Web Developer
Flynn Group of Companies
C:+1.416.994.3012
<EMAIL_ADDRESS>https://flynncompanies.com
From: Jerrie Pelser<EMAIL_ADDRESS>Sent: Wednesday, June 20, 2018 8:39:55 PM
To: auth0-community/auth0-xamarin-oidc-samples
Cc: Joshua Tanton; Mention
Subject: Re: [auth0-community/auth0-xamarin-oidc-samples] Support for Xamarin.Forms on Android (#6)
Very interesting... and disappointing ;) I sorta hoped that was the issue.
I'll keep looking into it, but I also want to ask you if you can find time to try and create a sample for me which demonstrates this issue. Unless I have some reliable way to reproduce this, I am just making guesses about possible causes.
BTW, when you call
client = new Auth0Client( new Auth0ClientOptions { Domain = ConstantsData.Auth0Domain, ClientId = ConstantsData.Auth0ClientId } );
Does ConstantsData.Auth0Domain and ConstantsData.Auth0ClientId have values? Are one of them not perhaps null?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-398940469, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfEe1OsJ0LW8O3DVHd6BCmOkEdHcSlF-ks5t-utbgaJpZM4OewL4.

That would be very much appreciated 😀

I'm sorry but I don't understand why the base classes Auth0Client and Auth0ClientOptions are no more inside the Core nuget package. Inside my login viewmodel in the Xamarin Forms .net standard pcl I have something like this:
var auth0Client = new Auth0Client(new Auth0ClientOptions
{
   Domain = Constants.Auth0Domain,
   ClientId = Constants.Auth0ClientId,
   Scope = "openid profile email"
});

but now it doesn't work anymore.
I don't want to create my own implementation of the IAuth0Client.
I don't understand.

It has never been inside the Core package. Auth0Client and Auth0ClientOptions has always been in the platform-specific packages.
The new core package was introduced specifically to introduce an non-platform specific IAuth0Client interface which you could reference inside your Xamarin Forms project. You will need to inject the actual platform-specific Auth0Client implementation via something like dependency injection.

mmm...maybe when the package was "unofficial" ?? ...

Hmm, I cannot remember those being in the Core package even while "unofficial". You say that you had it working in a PCL. Please tell me what version you were referencing in your PCL in which this worked.
As I stated, you will need to reference the Core package and use IAuth0Client in your PCL and then use dependency injection to inject the platform-specific Auth0Client implementation.
Unfortunately, however, I do not yet have a sample of how to do that for you.

do you mean something like this?
//PCL
public class LoginViewModel : BaseViewModel
{
    #region Fields

    private readonly IAuth0Client auth0Client;

    #endregion

    #region Lifecycle

    public LoginViewModel(IAuth0Client auth0Client)
    {
        this.auth0Client = auth0Client;
    }

    #endregion
}

//iOS
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    global::Xamarin.Forms.Forms.Init();

    #region Auth0

    var auth0Client = new Auth0Client(new Auth0ClientOptions
    {
        Domain = Constants.Auth0Domain,
        ClientId = Constants.Auth0ClientId,
        Scope = "openid profile email"
    });

    FreshIOC.Container.Register<IAuth0Client>(auth0Client);

    #endregion

    LoadApplication(new App());

    return base.FinishedLaunching(app, options);
}

//Android
protected override void OnCreate(Bundle bundle)
{
    TabLayoutResource = Resource.Layout.Tabbar;
    ToolbarResource = Resource.Layout.Toolbar;

    base.OnCreate(bundle);

    global::Xamarin.Forms.Forms.Init(this, bundle);

    #region Auth0

    var auth0Client = new Auth0Client(new Auth0ClientOptions
    {
        Domain = Constants.Auth0Domain,
        ClientId = Constants.Auth0ClientId,
        Scope = "openid profile email"
    });

    FreshIOC.Container.Register<IAuth0Client>(auth0Client);

    #endregion

    LoadApplication(new App());
}

Yes. I am not familiar with FreshIOC, but that seems to be what I have in mind.
Does that work for you?

sorry for the delay! yes it works. But...is there also another way to login with uath0 without leaving the app and open a browser?? Personally I think that the user experience is not so beautiful... 😅

@andrekiba I am not sure. I will investigate.

Hello, i'm trying to follow this example:
https://github.com/auth0-community/auth0-xamarin-oidc-samples/blob/master/Samples/Forms/FormsSample/FormsSample/MainPage.xaml.cs
But even after installing the NuGet Package Auth0.OidcClient.Core, I am unable to create a new instance of 'Auth0Client' as well as 'Auth0ClientOptions'. Could anyone assist me in getting this example to work? Very much appreciated for your time and help

@luminousAvocado  What do you mean by being unable to create an instance? Do you get errors? If so, what sort of errors? Compiler errors? Or errors at runtime?
Without a more detailed explanation, preferably with some screenshots, it is not possible for me to assist you.

I am closing this issue are the original issue (adding support for Xamarin Forms) have been addressed. If any new issues come up, pleases open a separate issue on GH.

@sdkraemer , would it be possible for me to see your solution using dependency injection?

My iOS version (which was working with the 2.0 upgrade) has now started having this exact same problem with a null reference exception. Why was the Controller/Activity property removed from the Auth0ClientOptions!?! It is just causing problems. Now it'll be a mess to downgrade to 1.0 so my Auth0 will actually work.

I was removed because that was the only way to get it working for Xamarin Forms. We cannot have platforms specific stuff in the Auth0ClientOptions otherwise it will not work on Xamarin Forms.
Please see if you can get some sort of stack trace or some way for me to reproduce it and then open an issue for that.

I just downgraded to 1.0 for iOS, took a while. But even with the Controller specified I'm getting the same NullReferenceException. How do I get you a stack trace? Is there a simple way to output this in VS without it being just a bunch of junk data? I'm going to go back to 2.1.0 where I'm having the same issue, there has got to be a way to prevent this NullReferenceException. In android you said it checked Android.App.Application.Context.PackageName; what does it check on iOS?

@joshuatantonflynn Please, I am asking you nicely: Open a separate issue for this
This issue is closed and not related to your issue. We cannot track this properly if you do not open an issue for your problem.
As far as the stack trace is concerned, you will need to debug your application, and then when it break on the exception, you will need to look at the stack trace of the exception being thrown.

I am locking this issue now, as Xamarin Forms support has been added.
For any problems, open a separate issue


show reason task is not up-to-date

Show the reason why a task is (would be) executed, e.g. "Missing target: x.y.z" or "Dependencey updated: a.b.c".
This should be implemented as part of doit info command.

@madsflensted this is now on master. Can you please test and check as you expected. Use:
$ doit info --status task_name

@felixfontein I was thinking that it would be better to display only the status and reason when the option --status is used. The normal output with file_dep, targets would be omitted.  What do you think?

@schettino72: both is fine for me. I only use doit info and doit info --status for debugging, and I spend most of the time finding out why exactly something changed, so running doit info twice instead of once doesn't really matter.

@felixfontein sorry for the long feedback cycle, summer vacation...
I just pulled the master and gave it a spin, and the extra information is very helpful in debugging my tasks.
Thanks :+1:

You're welcome! I already had some debugging sessions (before this feature) where I would have really liked something like that, too.


sqlalchemy.exc.OperationalError in Docker setup

Hi, thanks for your nice work!
When I clone this repo and run docker-compose up --build, I get the following error:
app         | /usr/local/lib/python3.7/site-packages/sqlalchemy/sql/functions.py:67: SAWarning: The GenericFunction 'array_agg' is already registered and is going to be overriden.
app         |   "is going to be overriden.".format(identifier)
app         | /usr/local/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
app         |   """)
app         | Traceback (most recent call last):
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2265, in _wrap_pool_connect
app         |     return fn()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
app         |     return _ConnectionFairy._checkout(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
app         |     fairy = _ConnectionRecord.checkout(pool)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
app         |     rec = pool._do_get()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
app         |     self._dec_overflow()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
app         |     compat.reraise(exc_type, exc_value, exc_tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
app         |     raise value
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
app         |     return self._create_connection()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
app         |     return _ConnectionRecord(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
app         |     self.__connect(first_connect_check=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
app         |     connection = pool._invoke_creator(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
app         |     return dialect.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 453, in connect
app         |     return self.dbapi.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect
app         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
app         | psycopg2.OperationalError: server closed the connection unexpectedly
app         | 	This probably means the server terminated abnormally
app         | 	before or while processing the request.
app         |
app         |
app         | The above exception was the direct cause of the following exception:
app         |
app         | Traceback (most recent call last):
app         |   File "manage.py", line 7, in <module>
app         |     app = create_app()
app         |   File "/app/api/__init__.py", line 71, in create_app
app         |     if not database_exists(db_url):
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 472, in database_exists
app         |     return bool(get_scalar_result(engine, text))
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 455, in get_scalar_result
app         |     result_proxy = engine.execute(sql)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2168, in execute
app         |     connection = self._contextual_connect(close_with_result=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2229, in _contextual_connect
app         |     self._wrap_pool_connect(self.pool.connect, None),
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2269, in _wrap_pool_connect
app         |     e, dialect, self
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
app         |     util.raise_from_cause(sqlalchemy_exception, exc_info)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
app         |     reraise(type(exception), exception, tb=exc_tb, cause=cause)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
app         |     raise value.with_traceback(tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2265, in _wrap_pool_connect
app         |     return fn()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
app         |     return _ConnectionFairy._checkout(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
app         |     fairy = _ConnectionRecord.checkout(pool)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
app         |     rec = pool._do_get()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
app         |     self._dec_overflow()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
app         |     compat.reraise(exc_type, exc_value, exc_tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
app         |     raise value
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
app         |     return self._create_connection()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
app         |     return _ConnectionRecord(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
app         |     self.__connect(first_connect_check=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
app         |     connection = pool._invoke_creator(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
app         |     return dialect.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 453, in connect
app         |     return self.dbapi.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect
app         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
app         | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
app         | 	This probably means the server terminated abnormally
app         | 	before or while processing the request.
app         |
app         | (Background on this error at: http://sqlalche.me/e/e3q8)
app         | /usr/local/lib/python3.7/site-packages/sqlalchemy/sql/functions.py:67: SAWarning: The GenericFunction 'array_agg' is already registered and is going to be overriden.
app         |   "is going to be overriden.".format(identifier)
app         | /usr/local/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
app         |   """)
app         | Traceback (most recent call last):
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2265, in _wrap_pool_connect
app         |     return fn()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
app         |     return _ConnectionFairy._checkout(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
app         |     fairy = _ConnectionRecord.checkout(pool)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
app         |     rec = pool._do_get()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
app         |     self._dec_overflow()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
app         |     compat.reraise(exc_type, exc_value, exc_tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
app         |     raise value
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
app         |     return self._create_connection()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
app         |     return _ConnectionRecord(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
app         |     self.__connect(first_connect_check=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
app         |     connection = pool._invoke_creator(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
app         |     return dialect.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 453, in connect
app         |     return self.dbapi.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect
app         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
app         | psycopg2.OperationalError: server closed the connection unexpectedly
app         | 	This probably means the server terminated abnormally
app         | 	before or while processing the request.
app         |
app         |
app         | The above exception was the direct cause of the following exception:
app         |
app         | Traceback (most recent call last):
app         |   File "manage.py", line 7, in <module>
app         |     app = create_app()
app         |   File "/app/api/__init__.py", line 71, in create_app
app         |     if not database_exists(db_url):
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 472, in database_exists
app         |     return bool(get_scalar_result(engine, text))
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 455, in get_scalar_result
app         |     result_proxy = engine.execute(sql)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2168, in execute
app         |     connection = self._contextual_connect(close_with_result=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2229, in _contextual_connect
app         |     self._wrap_pool_connect(self.pool.connect, None),
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2269, in _wrap_pool_connect
app         |     e, dialect, self
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
app         |     util.raise_from_cause(sqlalchemy_exception, exc_info)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
app         |     reraise(type(exception), exception, tb=exc_tb, cause=cause)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
app         |     raise value.with_traceback(tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2265, in _wrap_pool_connect
app         |     return fn()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
app         |     return _ConnectionFairy._checkout(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
app         |     fairy = _ConnectionRecord.checkout(pool)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
app         |     rec = pool._do_get()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
app         |     self._dec_overflow()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
app         |     compat.reraise(exc_type, exc_value, exc_tb)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
app         |     raise value
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
app         |     return self._create_connection()
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
app         |     return _ConnectionRecord(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
app         |     self.__connect(first_connect_check=True)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
app         |     connection = pool._invoke_creator(self)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
app         |     return dialect.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 453, in connect
app         |     return self.dbapi.connect(*cargs, **cparams)
app         |   File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect
app         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
app         | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
app         | 	This probably means the server terminated abnormally
app         | 	before or while processing the request.
app         |
app         | (Background on this error at: http://sqlalche.me/e/e3q8)

Any idea?

Sorry, it's my fault.
After undo my change in docker-compose.yml from
image: postgres:11

to
image: postgres:10

and it works...


chore: update sha for Control.LawfulFix

The only change here comes from a change in wlog in mathlib3.The change is already present in mathlib4.

<EMAIL_ADDRESS>

bors merge


Sort items in a file to make it readable top to bottom

I love that in Rust I can declare items in a file wherever I want.
On the other hand, I also like to read source files, typically top to bottom.
It would be great if rustfmt could have an opt-in option (e.g. via cargo fmt) that would sort the items in a file, so that ideally an item is declared / implemented before it is used in the implementation of another item (cargo fmt --sort-items).
A perfect output might not be always possible, but something "good enough" would already make many of my files much more "readable" top to bottom.
Also, if this is desired (I'd like something like it), it should probably be planned with configuration in mind, for example, in some cases, a user might want to interleave tests with items (e.g. the test of an item follow or preceed the item in the source file), while in other cases the user might want to put all the tests at the bottom of the source file, sorted top-to-bottom in the same order as the items. Relating a test to an item would need some heuristic, like the test should contain the item in its name or something.
Anyways, I just ended up writing a "huge" file (>2kLOC) and had to skim a lot through some "huge" files in the std library, and would have appreciated something like this.

Maybe sort items by usage?
fn foo() {
  bar();
  baz();
}

fn bar() {
  gah();
}

fn gah() {
  println!("Hello!");
}

After sort:
fn gah() {
  println!("Hello!");
}

fn bar() {
  gah();
}

fn foo() {
  bar();
  baz();
}

I'd really the ability to sort definitions of structs, unions and enums before their impls (eg to clean up the awful mess that bindgen produces). I also prefer a style of having impls of traits before impls of the struct, but I can live without that.

This would be particularly useful for generated code - we check in some prost generated code into our repo, and regenerating can sometimes have nondeterministic results with ordering of items in the files (even though they're semantically the exact same). Being able to sort the file somehow would be awesome 👍


Ssc 923 use prod factors

Use production factors from the actual system instead of lat/lon when getting size and dispatch from REopt. Additional required changes in SAM PR: https://github.com/NREL/SAM/pull/1165 Fixes #923
Steps to test:

Run the attached SAM and weather files in 2021.12.02:
2018_weather_file_dispatch.zip
Build SAM from this branch and the SAM branch sam_1092_update_reopt_script
See improved sizing and dispatch (via improved NPV) on branches

can you do a check if gen exists before adding the prod timeseries? I'm pretty sure the way it's run in the GUI calls simulate on the system first so gen should definitely exist, but technically this equation doesn't require simulate to be called beforehand.

Good thinking. What should the code do if gen doesn't exist? Throw an error, or revert to the lat/lon behavior? If the latter, is there a good losses assumption?

Yes I think using the lat/lon, which basically has REopt call PVWatts. Could losses be an optional input?


double-beep: Watch atallcures.com

double-beep requests the watch of the watch_keyword atallcures\.com. See the MS search here and the Stack Exchange search here.

atallcures\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by tripleee in Charcoal HQ


Logs in CLEO

CLEO is not showing logs at the moment but it might be helpful to see log statements when using CLEO.
Probably we can find a way to enrich the CLI by a -v (verbose) command flag, so that log statements are shown too.
The challenge is, that the json output can still be used by jq.
One option might be, that the logs could be redirected and printed to stderr instead of stdout, so jq can still operate on the output on stdout.

Duplicate of #14


EB3A feedback and controls

Hello,
Thanks for working on this component. It seems to have detected the majority of sensors on my EB3A:

Do you have plans to support any controls of Bluetti devices? (turn on/off etc). I am currently using ESP32 devices with https://github.com/mariolukas/Bluetti_ESP32_Bridge to do this (over MQTT -> ESP32 device -> bluetooth -> Bluetti).

I thought about adding them, but they could cause issues if bluetti changes the api in the future.
Maybe I'll add them, but add an option (for each devide) to enable them at your own risk.

Hello, seconded for some toggle controls.  I'm specifically looking to toggle the AC & DC output.
Thanks for all you hard work!

The switches for AC and DC Outputs are now working on my AC300.
I'll create the release today or tomorrow (have to fix the enum bug too).

New release is now available: 0.0.9


feat(adapters): support hono v4

Support Hono V4. Since the adapters are not versioned separately, I tried to make a minimally-breaking change - it requires no changes unless you use Cloudflare Workers, which has a breaking change in Hono v4^1.
This makes the types in the HonoAdapter slightly unsound. A proper long-term fix would be to change the API to accept handler: ({ root, rewriteRequestPath }) => MiddlewareHandler (where MiddlewareHandler is the return type of serveStatic).
Consumers could then construct serveStatic themselves, including requirements such as the manifest. That would, of course, require every consumer to update their HonoAdapter constructor, so maybe something to reserve for a major release.
Closes #721 (supersedes)

Thank you for this PR 🙏🏽

thanks king, right about time i started looking into it


Add new Brightway Documentation Page to pydata-sphinx Example Gallery

Dear pydata-sphinx-theme devs - many thanks for your hard work on this fantastic theme!
Our documentation has left the testing phase - we would be happy to add it to your "gallery of sites using this theme" page.
This follows up on https://github.com/pydata/pydata-sphinx-theme/pull/1119 and closes https://github.com/brightway-lca/brightway-documentation/issues/44.

Needs discussion, see https://github.com/pydata/pydata-sphinx-theme/issues/1121

@12rambau, I see - fair enough.
From what I can see (quick sample of some sites featured in the gallery), ours is currently the only project using git submodules (+GitHub Actions) extensively. It took quite a while to set up, but we now have a rather neat setup, which is explained in detail in the Contribution Guide: API Documentation.
I am certain this would be useful to projects looking to include docstrings from multiple repos in their API documentation. Despite the obvious advantages of a monorepo, some communities won't be able to give up distributed repos anytime soon.
Ultimately, we just want to help pydata-sphinx-theme users avoid having to set this up all over again. I'm not sure we would benefit from the 'advertising space' (cf. https://github.com/pydata/pydata-sphinx-theme/issues/1121#issue-1537706519) so much 😎
Let us know what you think!

I fully agree we just wait for #1221 to be closed before merging any new item in the list as the structure of the list itself may change

@12rambau, I see that https://github.com/pydata/pydata-sphinx-theme/pull/1221 has now been closed. Could we go ahead with the merge?

@12rambau, I see that #1221 has now been closed. Could we go ahead with the merge?

the relevant issue is #1121 not #1221

@michaelweinold, thanks for your patience, would you mind updating your branch so that idtracker.ai get into the list ? Note that you should set your site in alphabetical order.

Whops, just wanted to sync my branch. Hold on...

Whops, just wanted to sync my branch. Hold on...

Thank you for the update, @12rambau. I have added Brightway to the Other projects using this theme section for now. As I mentioned ealier (https://github.com/pydata/pydata-sphinx-theme/pull/1232#issuecomment-1456264767), we do have some nice customization around GH Actions, a GH App for automation and git submodules. If, in your opinion, this warrants inclusion in the Featured projects section, I'll happily move it there.


Support Multiple Wallboxes

Currently the list of registered wall boxes are fetched via graphql, but don't reflect into multiple devices being created with independent coordinators to fetch associated data.

not actually a problem, just need to restart the integration (lame, but acceptable)


sudo docker-compose logs -f   wouldn't work

I didn't copy paste exactly what the error was but it was something along the lines of [ERROR DEX_PATH /modules/blah/blah/blah]
I edit my docker-compose.yml to just use my full path and its working fine now.  however didn't work "out of the box"
/home/username/ergo/ergo-dex-backend/modules/utxo-tracker/target/docker/stage
/home/username/ergo/ergo-dex-backend/modules/amm-executor/target/docker/stage
/home/username/ergo/ergo-dex-backend/modules/pool-resolver/target/docker/stage
Brand new installation of ubuntu server 20.04.3

Yes, the environment variable set in the script isn't working even if explicitly exported first (Same for me on Debian). Had to hard code the paths.

Yes, the environment variable set in the script isn't working even if explicitly exported first (Same for me on Debian). Had to hard code the paths.

Try using the latest version of docker-compose. I had the same error when using the earlier versions (1.29.x)


Dataset

Hi!! I am facing issue for code execution  for my dataset which has some new fields and that are not numbers so any suggestion from ur side how should I proceed!

It is a little hard to understand your data. Do you mean your fields are something beyond item ID for each item? If in this case, may be you need two seperated user presentations and find a way to merge them together.

Thanks Will Try! I have warehouse name instead of Customer id.


Can't install black 20.8b1 with pip

pip install code2seq
Collecting code2seq
  Using cached code2seq-0.0.3-py3-none-any.whl (32 kB)
Requirement already satisfied: numpy==1.20.1 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (1.20.1)
Requirement already satisfied: wandb==0.10.20 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (0.10.20)
Requirement already satisfied: hydra-core==1.0.6 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (1.0.6)
Requirement already satisfied: pytorch-lightning==1.1.7 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (1.1.7)
Requirement already satisfied: omegaconf==2.0.6 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (2.0.6)
Requirement already satisfied: tqdm==4.58.0 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (4.58.0)
Requirement already satisfied: torch==1.7.1 in c:\miniconda\envs\code2seq-jb\lib\site-packages (from code2seq) (1.7.1)
Collecting black==20.8b1
  Using cached black-20.8b1.tar.gz (1.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  WARNING: Requested black==20.8b1 from https://files.pythonhosted.org/packages/dc/7b/5a6bbe89de849f28d7c109f5ea87b65afa5124ad615f3419e71beb29dc96/black-20.8b1.tar.gz#sha256=1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea (from code2seq), but installing version 0.0.0
WARNING: Discarding https://files.pythonhosted.org/packages/dc/7b/5a6bbe89de849f28d7c109f5ea87b65afa5124ad615f3419e71beb29dc96/black-20.8b1.tar.gz#sha256=1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea (from https://pypi.org/simple/black/) (requires-python:>=3.6). Requested black==20.8b1 from https://files.pythonhosted.org/packages/dc/7b/5a6bbe89de849f28d7c109f5ea87b65afa5124ad615f3419e71beb29dc96/black-20.8b1.tar.gz#sha256=1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea (from code2seq) has inconsistent version: filename has '20.8b1', but metadata has '0.0.0'
Collecting code2seq
  Using cached code2seq-0.0.2-py3-none-any.whl (32 kB)
  Using cached code2seq-0.0.1-py3-none-any.whl (32 kB)
  Using cached code2seq-0.0.0-py3-none-any.whl (32 kB)
ERROR: Cannot install code2seq==0.0.0, code2seq==0.0.1, code2seq==0.0.2 and code2seq==0.0.3 because these package versions have conflicting dependencies.

The conflict is caused by:
    code2seq 0.0.3 depends on black==20.8b1
    code2seq 0.0.2 depends on black==20.8b1
    code2seq 0.0.1 depends on black==20.8b1
    code2seq 0.0.0 depends on black==20.8b1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

i think there's a problem between windows and black 20.8b1, could you loosen the range of package versions?
thank you.

Hi!
Thank you for reporting! I release a new version of the model with removed dependencies to dev packages such as black. Try to install the latest version (0.0.4).