tensorboard not seeing event files

Please go to Stack Overflow for help and support:
http://stackoverflow.com/questions/tagged/tensorflow
If you open a GitHub issue, here is our policy:

It must be a bug or a feature request.
The form below must be filled out.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
no.  I am working with the full example to get the tensorboard to work.  I changed the file directory for the logs into something on my system:
train_writer = tf.summary.FileWriter('D:/logs_dt' + '/train', sess.graph)
test_writer = tf.summary.FileWriter('D:/logs_dt' + '/test')

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
Window 10
computer_specs.txt

TensorFlow installed from (source or binary):
binary with GPU

TensorFlow version (use command below):
1.1.0

Bazel version (if compiling from source):
n/a

CUDA/cuDNN version:
CUDA 8.0
cuDNN v5 for CUDA 8.0 (27 May 2016)

GPU model and memory:
NVIDIA GTX 1070 4GB

Exact command to reproduce:
from windows cmd:

tensorboard --logdir='D:\logs_dt'
You can collect some of this information using our environment capture script:
tf_env.txt
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
1.1.0
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
I'm not seeing anything on the tensorboard at all.  I can see where the log directory is created by the script, and the subdirectories /test and /train.   There are two files there (attached).  I point the tensorboard to the populated log directory, but it cannot see the event files.  I noticed that the names of the files ended in .AGENTDFT (the name of my computer).. perhaps it got parsed on there?  Not sure if its supposed to be that way.   Also, even as I try to attache the files directly, even github "doesn't support that file type".  I'm guessing how the event files were named has something to do with the issue.  I've zipped the log folder and attached that.
logs_dt.zip
This is the file that was run (it's the same as found in the tensorboard tutorial with only the directory changed.
tensor_board_hello.zip
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

This is the same issue as #8845, which also references #7856.   I was able to reproduce the same issue/failure with lgorX2.   i.e.  I downloaded his event data with the same failure as his (and mine).
Reviewing issue #7856; mrry commented on Feb 26:

Unfortunately TensorBoard uses a colon as the separator between the optional "run name" and the path in the --logdir flag. That means that --logdir=E:\tmp\tensorflow\mnist\logs is interpreted as a run named E with path \tmp\tensorflow\mnist\logs, which explains why it's sensitive to the current working directory.

As a quick workaround, you could avoid this problem by always specifying an explicit run name as part of the --logdir flag, e.g.:
`tensorboard --logdir=training:E:\tmp\tensorflow\mnist\logs
(Reassigning to @dandelionmane, who shows up on the blame` for the relevant code.)
I used this suggestion and it seemed to be a valid workaround  for the issue I described above.  However, I hope this stays open as a bug, because it is one.  A "quick workaround" is nice, and hopefully we can get a more permanent fix.  At a minimum, maybe add this in the tutorial as a note for windows users so they can get up and running quickly.

related to #9701?

It looks like @IgorX2 had same issue in #8845.  I reproduced his error too with his data.   His thread references #7856, which has the following workaround posted by @mrry on 26 Feb

Unfortunately TensorBoard uses a colon as the separator between the optional "run name" and the path in the --logdir flag. That means that --logdir=E:\tmp\tensorflow\mnist\logs is interpreted as a run named E with path \tmp\tensorflow\mnist\logs, which explains why it's sensitive to the current working directory.
As a quick workaround, you could avoid this problem by always specifying an explicit run name as part of the --logdir flag, e.g.:

tensorboard --logdir=training:E:\tmp\tensorflow\mnist\logs

(Reassigning to @dandelionmane, who shows up on the blame for the relevant code.)

This workaround worked for me.  It seems to be a valid bug and the workaround seems valid.   I hope this helps others trying to get this running in windows.  At a minimum, perhaps put a note in the tutorial for windows users to specify the explicit run name too?
Very exciting stuff you guys are working on!  Hate to see others get slowed down if a simple fix would work.

@dandelionmane @jart

I'll write up a change soon to work around this issue. I'm not sure if a perfect solution is possible. It might be best if we just not allow single character run names. Or maybe only impose that behavior on Windows, or when backslashes are used.

Thanks for reporting this. I've migrated it to our new repository at https://github.com/tensorflow/tensorboard/issues/51.


CQ 4348320 text runtime testcases

Added support for text component runtime test cases.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[ ] I have signed the Adobe Open Source CLA.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes and the overall coverage did not decrease.
[ ] All unit tests pass on CircleCi.
[ ] I ran all tests locally and they pass.

it seems you need to rebase it.


Coloring root nodes of collapsed clades?

We talked a bit about this a few days ago, so I'm making a note of it here for future reference. I think it might make sense to color in the root nodes of collapsed clades, since they would already be colored that way if collapsing were not done. If opinions are split on which option (color root vs. don't color root) looks better / is more useful, we could make this an option in "Tree Properties" as well.

for reference, this seems to be configurable by removing this line:
https://github.com/biocore/empress/blob/4f6ddd3a4e03b85703f733bd75b9771ef82157b4/empress/support_files/js/empress.js#L2291-L2293
here's what this looks like on the same portion of the MP tree --

The main benefit is that this is nice for certain trees where the collapsed clade's area is relatively small, e.g. the MP tree in rect layout collapsed at level 1 taxonomy --

notice the small red clade containing the only Archaea-classified features in the tree. In the first screenshot it's still visible (it's just really tiny), but in the second screenshot coloring the root branch red makes (like normal) makes it a lot more visible.

Thanks for putting this together @fedarko, this makes a lot of sense. Thinking about it the collapsing shouldn't change the coloring of the branches, so we either extend the polygons to the top of the branch, or we color the branch as you suggest. I suspect leaving the branch makes for a more aesthetically pleasing representation.


Error in Kivy install instructions: PIP: externally-managed-environment

Software Versions

Python: 3.12.3
OS: Linux Mint 22 Cinnamon
Kivy: (latest)
Kivy installation method: PIP

Describe the bug
The following instructions on installing Kivy with PIP on Linux, from https://kivy.org/doc/stable/gettingstarted/installation.html#setup-terminal-and-pip doesn't work:
Setup terminal and pip¶
Before Kivy can be installed, Python and pip needs to be pre-installed. Then, start a new terminal that has Python available. In the terminal, update pip and other installation dependencies so you have the latest version as follows (for linux users you may have to substitute python3 instead of python and also add a --user flag in the subsequent commands outside the virtual environment):
python -m pip install --upgrade pip setuptools virtualenv

In my Linux Mint 22 Terminal I tried these 2 variants etc.:
:~$ python3 -m pip install --upgrade pip setuptools virtualenv

:~$ python3 -m pip install --upgrade pip setuptools virtualenv --user

This is the error I get:
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
I can add that this is my PIP version:
:~$ pip --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)

Expected behavior
PIP installation of Python packages needed for Kivy...
To Reproduce
Follow the Kivy install instructions from https://kivy.org/doc/stable/gettingstarted/installation.html#setup-terminal-and-pip in a Terminal on Linux Mint 22 Cinnamon.
Code and Logs and screenshots
None.
Additional context
Since nobody have responded to https://github.com/kivy/kivy/issues/8800 I hope someone will respond to this. If not, I will have to conclude that many many months of Python-Kivy app development has been lost, because Kivy is not yet viable for real life apps on Android. That would be VERY sad!
I look forward to hear from you.
PS: I also posted this problem here: https://groups.google.com/g/kivy-users/c/v3iBhupVAC4 - 24 hours ago.
Nobody have responded. I just posted a comment asking people to respond here, instead of there.

This is not a Kivy-related issue. On recent OS releases with a default Python installation, it's necessary (and recommended) to use a virtual environment for installing Python packages to prevent affecting system-wide packages.
See: https://stackoverflow.com/a/75722775

This is a Catch 22. You are asking me to install in a virtual environment, while I am referring to a command in the install instruction that is supposed to be used BEFORE creating a virtual environment, in order to update the packages needed for the virtual environment.....

Have you tried using apt.
Something like:
sudo apt update
sudo apt install python3-virtualenv

It is probably one of these:
apt search venv

python3-venv/noble-updates 3.12.3-0ubuntu2 arm64
  venv module for python3 (default python3 version)

python3.12-venv/noble-updates,noble-security 3.12.3-1ubuntu0.1 arm64
  Interactive high-level object-oriented language (pyvenv binary, version 3.12)

# python3 -mvenv venv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.12-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: /venv/bin/python3

I ended up successfully installing Kivy in a virtual environment created with ".../mypython$ python3 -m venv venv-mint-22" which I think uses the 'python3-venv' package, which I THINK was already in Linux Mint 22 Cinnamon (a distro based on Ubuntu 24.04) by default...
But that does not change the fact that the Kivy install instructions do not really work for Ubuntu 24.04 based distros.
The install instructions for Buildozer - https://buildozer.readthedocs.io/en/latest/installation.html - are also not up to date:
It starts with: pip3 install --user --upgrade buildozer
Since it contains "--user" I can deduct that it should be executed outside the virtual environment, but that ALSO results in: error: externally-managed-environment
Does that mean I HAVE to install buildozer inside the virtual environment (on Ubuntu 24.04 based Linux versions)?

In the end I had to choose Linux Mint 21.3 (which is based on Ubuntu 22.04) to make it work.
I would still say that there is an error in the install instructions, because it does not mention that Kivy (and especially Buildozer) does not work with Ubuntu 24.04 and distros build on that.

See also https://github.com/kivy/buildozer/issues/1859


Upgrade operator-sdk to v1.31.0

What this PR does / why we need it:
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
Special notes for your reviewer:
Checklist:

[ ] Fixes #
[ ] Labelled this PR & related issue with documentation tag
[ ] PR messages has document related information
[ ] Labelled this PR & related issue with breaking-changes tag
[ ] PR messages has breaking changes related information
[ ] Labelled this PR & related issue with requires-upgrade tag
[ ] PR messages has upgrade related information
[ ] Commit has unit tests
[ ] Commit has integration tests

@Saranya-jena can you please re-run the checks


[Documentation Update]:

Is there an existing issue for this?

[X] I have searched the existing issues

Issue Description

Suggested Change
I would like to enhance the quality of the images in the website.
Rationale
No response
Urgency
Medium
Record

[X] I have read the Contributing Guidelines
[X] I'm a GSSOC'24 contributor
[ ] I'm a VSOC'24 contributor
[X] I have starred the repository

@Nikhith221B I have assigned u this time . But from next time please try to fill up the issue with more info properly & with proper issue name
& I will assign u the labels after reviewing the PR . Don't worry


Use unicode for encoding when using postgres.

This is a 🐞 bug fix.

[ ] I've added tests (if it's a bug, feature or enhancement)
[x] I've adjusted the documentation (if it's a feature or enhancement)
[x] The test suite passes (run bundle exec rspec to verify this)

Summary
This pull changes the encoding for postgres database configurations. By default the utf8mb4 encoding would be used for both mysql and postgres. This is incorrect as postgres returned an error upon trying to use utf8mb4 as encoding.
Rails itself also using the unicode encoding for postgres, see: https://github.com/rails/rails/blob/235eb91bad58ab18b45aa36fa3a1ebedfe1c4879/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt.
I couldn't find where the jets new command is being tested so not sure if tests should still be added for this. If so I could use some guidance on that.
Context
This is not related to any other issue. Upon creating a new jets project using postgres I received the following error:
PG::Error: ERROR:  invalid value for parameter "client_encoding": "utf8mb4"
Version Changes
This is a bugfix so a minor version change would suffice (e.g. 2.2.2).

Released in v2.2.2


feat: support = operator in function args

Now if functions support named args, we can use python style = assignment in the function instead of the lesser known => assignment operator
ex:
# before
select * from read_csv('some_file', delimiter => ';');

# after
select * from read_csv('some_file', delimiter = ';');

Note: the => operator still works.

so it turns out this breaks a lot of generated queries, such as the ones generated from prql. We'd likely need some way to configure this per function. Closing this for now as it's a lot more work than initially intended.


Coap.Net

Hi,
Please let me know how we can send the token to  COAP server and how we can define message type (CON, NON, ACK, RST) when we send client request to COAP server.
Thanks

Hi~
About token:
Token is defined as a property in Message class:
byte[] Message.Token { get; set }

It is an array of bytes, with 0 - 8 bytes.
If not set, the TokenLayer inside will generate a token for each request.
Request request;

request.Token = new byte[] { 0xab, 0xcd };

About message type:
It is not recommended to define the message type of requests directly,
because normally a request can only be CON or NON.
To specify CON/NON to a request, use this constructor:
Request(Method method, Boolean confirmable)
while the second param indicates whether this request is CON or not.
true for CON, false for NON. The default value is true.
If you really want to set the message type manually, please refer to the
Type property in Message class:
MessageType Message.Type { get; set; }


Please implement deflating heap arrays from foregin calls

Aim
I want to receive a two dimensional array from an oracle.
Expected Behavior
It works
Bug
The application panicked (crashed).
Message:  not implemented: deflattening heap arrays from foreign calls
Location: /Users/runner/work/noir/noir/acvm-repo/brillig_vm/src/lib.rs:295

To Reproduce

Create an oracle that returns a 2d array
Try to compile

Project Impact
Nice-to-have
Impact Context
Without this - I need to linearise arrays and have serde logic in Noir
Workaround
Yes
Workaround Description
custom serde
Additional Context
No response
Installation Method
Binary (noirup default)
Nargo Version
nargo version = 0.25.0 noirc version = 0.25.0+3ad88696ab63d8b1838b4ca7e9a3a97f823ca976
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response

Also - the type in @noir-lang/acvm_js doesn't support 2d arrays
export type ForeignCallOutput = string | string[]

For context: I'm trying to prove ethereum receipt inclusion. Receipts include arrays of logs. And each data is an array by itself, so would be really nice to have nested structures support in oracles

@LogvinovLeon Would you add reproduce?

Here is the repro: https://github.com/vlayer-xyz/noir-oracles-2d-arrays-repro

Use cases for it:

We want to ask an oracle to return us an array of storage proofs. Each storage proof is a struct containing arrays as it's fields.
Because Option type is not supported in brillig we want to simulate option with a struct Optional<T> { value: T, is_some: bool}, but brillig does not support nested structs

Thanks @LogvinovLeon. Updated the Issue body with what I believe are the steps for reproduction, let us know if any of them is in conflict with your intention / experience 🙌


Any idea why I have this error?

F:\network_node\new_osap\modular-things>npm run dev

<EMAIL_ADDRESS>dev
astro dev

astro  v2.0.4 started in 51ms
┃ Local    http://localhost:3000/
┃ Network  use --host to expose
06:35:25 PM [serve]    404 /network_node/new_osap/modular-things/src/components/index

My setup step:
git clone https://github.com/modular-things/modular-things.git
cd modular-things
npm install
npm run dev
Is there any file missing?  Please advice.

@jakeread  could you advice how to workaround this?
Thanks,
KN


.Net: Delay after a semantic function has been called

When calling Semantic Kernel with InvokePromptAsync with ToolCallBehavior.AutoInvokeKernelFunctions, one can learn from the debug traces that the correct function is called, and the duration it took to produce the result, but then the library doesn't return immediately to the calling code, proven by the fact that the total time traced is much higher. See below for the duration it took to call the function (3.755 s) versus the total time it took to return to the caller (22.634 s).
How can this time be reduced? Is this time spent in the Semantic Kernel library, or waiting on other calls? The observability traces do not show what is happening in between. This creates the perception that the app/chatbot is slow when using Semantic Kernel. A chat completion call directly to the LLM is very fast in comparison.
To Reproduce
Steps to reproduce the behavior:

Register at least 2 plugins (with one function each).
Craft a prompt that would end up calling one of the functions.
Call await kernel.InvokePromptAsync(prompt, new OpenAIPromptExecutionSettings { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions })
Observe from debug traces the correct function gets called, and its duration
Observe from debug traces that more time passes before the call returns to the caller
Observe from debug traces the total duration is much larger than the time reported for the function call

Expected behavior
A time delay does not occur, or a trace explains what is being waited on.
Example output
Observe below the difference between the function call duration (3.755 s) and the total duration (22.634 s).
GenFewSentences: Information: Function GenFewSentences succeeded.
GenFewSentences: Trace: Function result: [REDACTED].
GenFewSentences: Information: Function completed. Duration: 3.755162s
Microsoft.SemanticKernel.Connectors.OpenAI.AzureOpenAIChatCompletionService: Information: Prompt tokens: 404. Completion tokens: 51. Total tokens: 455.
Microsoft.SemanticKernel.KernelFunctionFactory: Information: Prompt tokens: 404. Completion tokens: 51.
InvokePromptAsync_061e7ab889354c0ca2da5604ff6b3b97: Information: Function InvokePromptAsync_061e7ab889354c0ca2da5604ff6b3b97 succeeded.
InvokePromptAsync_061e7ab889354c0ca2da5604ff6b3b97: Trace: Function result: [REDACTED].
InvokePromptAsync_061e7ab889354c0ca2da5604ff6b3b97: Information: Function completed. Duration: 22.6347055s

Platform

OS: Windows
LLM: Azure Open AI - GPT-4 turbo-2024-04-09
IDE: Visual Studio, VS Code
Language: C#
Source: Microsoft.SemanticKernel v1.11.1

Additional context
No planner has been used. Auto invoke kernel functions was requested as part of the InvokePromptAsync call.

@azure-claudiu Thanks for reporting this issue!
22.634 seconds is definitely a lot, but I cannot reproduce this issue locally using console application.
May I ask you to run Debug > Performance Profiler with Instrumentation enabled in Visual Studio?

This should output the breakdown for each C# function, execution time and number of calls:

With this view, you should be able to see where exactly there is a delay in execution.

Observe below the difference between the function call duration (3.755 s) and the total duration (22.634 s).

After GenFewSentences is invoked, it's going to make a new request back to the service with the full existing chat history plus the result of GenFewSentences. Isn't the time after GenFewSentences just that secondary roundtrip to the model, including its full generation of all tokens in the response?

Isn't the time after GenFewSentences just that secondary roundtrip to the model, including its full generation of all tokens in the response?

That's true, the second roundtrip may be a problem. @azure-claudiu If you don't want to send second request to LLM and instead return function result immediately, you can terminate the process with auto function invocation filters, like in this example:
https://github.com/microsoft/semantic-kernel/blob/7cb651a809a34ed8cbb35d7695db182382024ec7/dotnet/samples/Concepts/Filtering/AutoFunctionInvocationFiltering.cs#L79
This will return function result as it is, which should improve execution time. But this result won't be formatted or re-phrased by AI, so it depends if plain function result will work in your scenario or not.

I see; I wasn't aware of a second request. I tried the IAutoFunctionInvocationFilter approach and it seems to work! Now the kernel invoke returns the result generated by the function (1) immediately and (2) unchanged. This explains why previously the output of the function was not returned verbatim, but it was slightly modified (rephrased), which was undesirable for our use case.
The difference between the function call duration and the total duration is now smaller, and it's only due to the time spent before calling the function.
Thanks for clarifying this behavior and providing the solution!

I have a question though. By setting context.Terminate = true I am preventing a secondary call to the LLM (which I want) but I'm also preventing a secondary call to one of my functions (which I don't want).  Is there a way to just disable this non-plugin call to the LLM?

From the documentation of the Terminate property:
As soon as it's set to true, the remaining functions won't be executed and last request to LLM won't be performed. Automatic function invocation process will be terminated and result of last executed function will be returned to the caller.

I guess I'd like the remaining functions to be executed, but the last request to the LLM to be skipped.

but I'm also preventing a secondary call to one of my functions (which I don't want)

What secondary call are you referring to? Can you elaborate on the scenario?
With function calling, the client gives the chat history to the model along with a list of functions the model is able to request be invoked if it deems that valuable. The model/service then sends back a response, which is either the final response or an intermediate request for a function to be invoked. In the latter case, SK will invoke the function and send back the results. At which point the model may send back a final response or may ask for another function to be invoked. And so on. After invoking a function and before sending back the results, the client has no idea whether the model will request another function to be invoked or not.

Certainly. As a generic example, let's assume I have 2 functions: GenerateHaiku and ValidateHaiku.
I noticed this flow when using the prompt:
"Generate a haiku" -> LLM -> GenerateHaiku -> LLM -> back to caller
That second call to the LLM doesn't return the output of the GenerateHaiku function as is, but processed (changed, rephrased) and it also add extra time. Since I don't want that behavior, I can use context.Terminate = true and the output of GenerateHaiku is returned immediately and unchanged to the caller.
But if I wanted to use the prompt:
"Generate a haiku and validate it" -> LLM -> GenerateHaiku -> LLM -> ValidateHaiku -> LLM -> back to caller
The last call to the LLM is again not desired because of extra processing it might do to the output of the ValidateHaiku function, and the extra time it takes. If I use context.Terminate = true when filtering the GenerateHaiku call, I will prevent the call to ValidateHaiku to take place.
Would there be a way to avoid the processing of that last LLM call? I noticed I can't tell from the auto invocation filter that we're dealing with the last function call (i.e. context.FunctionCount == 1 always).

Would there be a way to avoid the processing of that last LLM call? I noticed I can't tell from the auto invocation filter that we're dealing with the last function call (i.e. context.FunctionCount == 1 always).

We don't know if it's the last. The model can always ask for additional functions to be invoked as it sees fit. Only you have the context to know whether you consider it to be done or not. So, for example, if you want to always end after ValidateHaiku is called, you can check which function is being invoked and terminate if it's ValidateHaiku.
There's just a loop here like the following pseudo-code:
while (true)
{
    var response = SendRequest(history);

    if (response.HasFunctionCallRequests)
    {
        var results = PerformFunctionCalls(response);
        UpdateHistory(history, response, results);
        continue;
    }

    return response;
}

SK has that loop built-in for you to use optionally, but if you don't, you'd just need the same loop in your own code. Whatever you'd do to choose to break out of the loop is what you check for and use to set terminate in the filter.

I think we can close this issue. I will experiment more with function composability, but the ability to return immediately after a function call solves my immediate problem. Thank you!


IncludeScopes in config doesn't work in the template

See:
https://github.com/aspnet/Logging/issues/643
Please fix before RTM

@pakrym any follow-up to https://github.com/NinoFloris/MetaPackages/commit/706c2c09d4f59c83ad8780f6c46c6f41edb30af0 needed here? Or is this good to close?


Possible bug: demand is extrapolated twice

The predict_demand_in_year function extrapolates the electricity demand for a given year, using a requested target year and the YearOfDemand in the DemandDf object. However, it fails to adjust the YearOfDemand to the extrapolated year. The bug exhibits itself when predict_demand_in_year is called on one of its results. The first run is in run_scenarios.py#L72-L78, and the result is passed onto simulate_use, which later calls predict_demand_in_year on the same data internally in get_usage_profile.
What do you think? Am I missing something? I solved this in our repo, and would be happy to create a PR with a similar patch.

Hi @Plutoberth! currently I'm a bit busy to dive into the code. I'll be available from Tuesday onwards if needed. In the meanwhile I have sent you an invitation to join the repo feel free to commit any changes you see fit, let me know if anyone else on the team needs permissions.


[Request] NS Switch: Tlicolity Eyes

https://vndb.org/v22597

This one has a PC version. Does that not work with Textractor?


Fix migration errors on form_submissions

This PR updates the form_submissions update migration to check it needs to be run. It also ensures we only drop the foreign key if it exists.
Closes: https://github.com/statamic/eloquent-driver/issues/323
Fixes: https://github.com/statamic/eloquent-driver/pull/285#issuecomment-2230351766

@ryanmitchell  I seem to be getting an issue when running this:
   INFO  Running migrations.

  2024_05_15_100000_modify_form_submissions_id ........................................................................................... 25ms DONE
  2024_06_11_183314_drop_status_on_entries ................................................................................................ 5ms DONE
  2024_06_11_183314_relate_form_submissions_by_handle .................................................................................... 13ms FAIL

   Error

  Class "Doctrine\DBAL\Driver\AbstractMySQLDriver" not found

  at vendor/laravel/framework/src/Illuminate/Database/PDO/MySqlDriver.php:8
      4▕
      5▕ use Doctrine\DBAL\Driver\AbstractMySQLDriver;
      6▕ use Illuminate\Database\PDO\Concerns\ConnectsToDatabase;
      7▕
  ➜   8▕ class MySqlDriver extends AbstractMySQLDriver
      9▕ {
     10▕     use ConnectsToDatabase;
     11▕
     12▕     /**

      +5 vendor frames

  6   database/migrations/2024_06_11_183314_relate_form_submissions_by_handle.php:62
      Illuminate\Database\Connection::getDoctrineSchemaManager()

  7   database/migrations/2024_06_11_183314_relate_form_submissions_by_handle.php:31
      Statamic\Eloquent\Database\BaseMigration@anonymous\/Users/danieljones/Dev/pelorus-travel/database/migrations/2024_06_11_183314_relate_form_submissions_by_handle.php:9$1fb::listTableForeignKeys("form_submissions")

However, if I run the migration a second time after it succeeds:
   INFO  Running migrations.

  2024_06_11_183314_relate_form_submissions_by_handle  3ms DONE

@DanielDarrenJones this work any better? https://github.com/statamic/eloquent-driver/pull/324/commits/0d251c7404d022a5776caa99edce34b16247cfd2

@ryanmitchell that seems to run fine against my project! :)

@DanielDarrenJones can I just check you had cleared the previous migration entry from your migrations table before testing?

@DanielDarrenJones can I just check you had cleared the previous migration entry from your migrations table before testing?

Yeah I ran from a backup of our live statamic 4 project (we were just in the process of deploying v5 so this was perfect timing)

@DanielDarrenJones awesome thanks for confirming


boilerplate++

I ran make boilerplate-update

Codecov Report

Merging #59 (15911f9) into main (1cedd8c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage   65.49%   65.49%
=======================================
  Files          23       23
  Lines        1078     1078
=======================================
  Hits          706      706
  Misses        291      291
  Partials       81       81


AspectFill image cropping different on iOS and UWP (Xamarin Forms)

Thank you for this wonderful library! It has solved so many issues I've had with the default Xamarin Forms Image view. I found a small bug though:
When displaying an image with AspectFill the displayed portion of the image is cropped from the center of the image on iOS but from the top left corner on UWP.
My image is wider than it needs to be and is included in the xaml like so:
<ffimage:CachedImage Source="{Binding BackgroundImage}" Aspect="AspectFill" />
This is the source image:

It looks like this on iOS (which is what I want):

However it looks like this on UWP:

On a related note, did you consider including a property which could be used to define where to crop the image, eg. center, topleft, left,...?

Hi @dominik-weber,
It's because of the difference how Windows handles image aspect ratios. Read more here: http://stackoverflow.com/questions/13535022/windows-8-image-uniformfill-centered
Xamarin.Forms Image has the same issue. If you have any idea how could we solve it, please let me know.

On a related note, did you consider including a property which could be used to define where to crop the image, eg. center, topleft, left,...?

Sure we could add that (I already added some properties for transformations instead using constructors), but it's a low priority for now. If you have something - feel free to collaborate.

I think this could be fixed by setting the HorizontalAlignment and VerticalAlignment properties of the Image to Center. See this pull request: https://github.com/xamarin/Xamarin.Forms/pull/190
In the screenshot below I tried setting these properties on the middle item (Contoso Tax). Notice how the red borders expand beyond the visible area of the image. If I set HorizontalAlignment to Stretch the image expands outside the visible area to the right. If I set it to Center it expands equally on both sides.

Thanks for a help! It's fixed, prerelease nuget coming soon.

Nice, thanks! :+1:

Prerelease NuGet package containing the fix released. Could you test it?

works perfectly, thanks! :)

I'm afraid this issue isn't completely fixed... I did some more testing and figured the following:

Fill: works fine
AspectFill: works fine
AspectFit: doesn't work

In this screenshot I've added an image whose layout is illustrated by the red rectangle, with Aspect set to AspectFit. On iOS the image is centered however on UWP it is aligned to the left.

I've created a sample app to test all different Aspect values and XForms Horizontal/VerticalOptions values and found that when setting the UWP Control.HorizontalAlignment and Control.VerticalAlignment to Center it works fine in all scenarios. So I would suggest removing the alignment modifications from the UpdateAspect method and just setting it during control initialization:
            var control = new Image()
            {
                Stretch = GetStretch(Xamarin.Forms.Aspect.AspectFill),
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center
            };
            control.ImageOpened += OnImageOpened;
            SetNativeControl(control);

@daniel-luberda have you seen the comment i've added?

@dominik-weber Hi, I've missed that, sorry. Sure, we can change it to have a unified behavior.

just fyi, here is the project I've used to test the different scenarios on UWP. Uncomment all lines from UWP/ImageExtRenderer to see the differences.
FFImageCropTest.zip

Thank you for the quick implementation @daniel-luberda ! Let me know when it's available on nuget and I will run some tests.

2.1.8-pre-155 released. Could you test it?:)

Unfortunately no, does not work :(
I've checked the sources of XForms, you can see that the Alignment properties are overwritten here: https://github.com/adamped/Xamarin.Forms/blob/6a23187f26aeea3e33d2f3c9a77172f062c7a519/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs#L290
So we need to set them after calling SetNativeControl:
        if (Control == null)
        {
            Image control = new Image()
            {
                Stretch = GetStretch(Xamarin.Forms.Aspect.AspectFill),
            };
            control.ImageOpened += OnImageOpened;
            SetNativeControl(control);

            // must set alignment properties after SetNativeControl
            Control.HorizontalAlignment = HorizontalAlignment.Center;
            Control.VerticalAlignment = VerticalAlignment.Center;
        }

Thank you for your help and debugging. I'll push a commit with fixes now.

2.1.8-pre-158 could you test it? There were also some changes how transformations are handled on Windows, look here: https://github.com/luberda-molinet/FFImageLoading/commit/f90bd976a43e9a15bb88b68cbb603a30182bac56
Is transformations performance better now?

works 👍 thank you very much! :)
I only use transformations to show a very small user image as a circle, didn't notice any difference...

Hmm... I ran some more tests regarding transformations on UWP:
            for (int i = 0; i < 1000; i++)
            {
                var image = new ImageExt();
                image.Source = "https://blog.optimizely.de/files/2014/01/test.jpg";

                for (int j = 0; j < 1000; j++)
                    image.Transformations.Add(new BlurredTransformation());

                contentLayout.Children.Add(image);
            }

So add 1000 times the same image, applying 1000 blurred transforms each.
However I did not notice any difference:

Lots of GCing though ;)

Hi @dominik-weber,
Thanks for such a detailed tests, those are really useful as I don't work a lot with UWP currently. Actually, with that code, only one transformation operation was performed. All other images were loaded from cache. You would need to use a different image for every image loading operation or disable memory cache for that images. With recent changes, I just added a lock which allows only one transformation operation to perform at a time to reduce abnormal cpu/memory usage. That's why I was wondering if the transformation performance has changed.
Thanks,
Daniel

Alright, I wasn't sure about that (although I was impressed by the performance ;) )
I have modified the test to load individual images:
            contentLayout.Children.Clear();

            var random = new Random();

            for (int i = 0; i < 200; i++)
            {
                var image = new ImageExt();
                image.Source = "https://blog.optimizely.de/files/2014/01/test.jpg" + "?r=" + random.Next();

                for (int j = 0; j < 5; j++)
                    image.Transformations.Add(new BlurredTransformation());

                contentLayout.Children.Add(image);
            }

And ran this test with 50x50 (50 images with 50 transforms each) and a much more realistic configuration of 200 images with 5 transforms each.

You can see that with the new version the cpu usage and memory consumption are much smoother. However particularly with the 200x5 example the difference in memory consumption is negligible and the duration it takes for the test to complete is a bit higher. The UI was responsive during all tests, at least on my desktop. Did not run the test on a mobile phone.
So from running this test I'd say the results are inconclusive, we have to observe more real world scenarios before we can tell if the change was a success or not.
Do you have a real use case that inspired you to implement the change?

@dominik-weber Impressive profiling! :) Thanks a lot for that.
It was changed mainly because of mobile phones. There were cases where doing a lot of image processing at once caused application crash (because of abnormal cpu/memory usage). The lock eliminates that.
On the other hand, UWP is used also on desktop apps. Is there any way to determine if UWP app is run on desktop? If yes, we could lock only on mobile phones, preserving performance on a desktop apps.

You could check this with the following code:
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Desktop")
However this seems a bit "hacked"... also there are still desktop pcs with very little RAM.
https://msdn.microsoft.com/de-de/library/windows.system.profile.analyticsversioninfo.devicefamily.aspx

The values of this property will change over time as new device families are released. You should not depend on the value of this property, it is intended for analytics use only. For example, you could prioritize marketing activities based on data that more of your customers are using one device-family versus another device-family.

Yes, I agree. It's a bit "hacky" :)
For now, non-locking transformations are only 2-3s ahead of a locking ones, with 200 images x 5 transformations. I think the pros (more balanced memory / cpu usage) are more important, so we can keep locking for a better mobile devices stability.

There's also an old branch with a better performing transformations: https://github.com/luberda-molinet/FFImageLoading/tree/windows-new-bitmapholder-optimization - it may have some significant improvements on Windows. (UWP changed WriteableBitmap underlying pixel data from int array to byte array, FFImageLoading is using int array (caveat from Silverlight). But it will force users to refactor all existing custom transformations)


[ Documentation request ] Update Keploy twitter card image

Brief description
As the logo of Keploy has changed, the twitter card in the documentation need to be updated too. Here is the old one. Change the image to a newer one keeping the path same.
Your recommended content
You can take reference from here for the update.

sure @jayeshchoudhary