text:
Adding AddRange to dictionary cause a update on FK

When adding child objects to a dictionary collection from the child type the child objects are updated to the first parent that what added to the dictionary key bucket.
Steps to reproduce
public class Parent{
    public Guid Id { get; set; } = Guid.NewGuid();
    public string Code1 { get; set; }
    public string Code2 { get; set; }
    public List<Child> Childs{ get; private set; } = new List<Child>();
}
public class Child{
    public Guid Id { get; set; } = Guid.NewGuid();
    [ForeignKey("ParentFK")]
    public Guid ParentId { get; set; }
}

//Code to use parent / childs

var dict = new Dictionary<string, List<Child>>();
foreach (var code in new [] {"C0","C1","C2","C3","C4","C5"})
{
         var items = (await dbcontext.Reqests
                //    .AsNoTracking()
                    .Include(r => r.Childs)
                    .Where(r => r.Code1== code)
                    .ToListAsync().ConfigureAwait(false))
                    .ToDictionary<Parent, string>(r => r.Code2);

          foreach (var key in items.Keys)
                {
                    if (dict.ContainsKey(key))
                        dict.[key].AddRange(items[key].Childs); //Here are fks changed
                    else
                    {
                        dict.Add(key, items[key].Childs);
                    }
                }
}
dbcontext.SaveChanges();

When the SaveChanges call is made, the fk is updated in the database. The dict.[key].AddRange(items[key].Childs);  does trigger the changes to be tracked. Child objects are updated to belong to the 'first parent of the dictionary bucked'.
I would have expected no changes are tracked.
The .AsNoTracking() will prevent tracking and the update.
Further technical details
EF Core version: (found in project.csproj or packages.config)

all
runtime; build; native; contentfiles; analyzers

Database Provider:
Microsoft.EntityFrameworkCore.SqlServer
Operating system:
Windows / Linux / Docker container on linux

@pgroene This issue is lacking enough information for us to effectively reproduce. Please post a runnable project/solution or complete code listing that demonstrates the behavior you are seeing.

You can find a sample project here:
https://github.com/pgroene/ef-dictionary/

@pgroene I'm still not following what is unexpected executing the code. Many Child objects are added to the collection pointed to by the Parent.Childs navigation property. These are then persisted to the database when SaveChanges is called. What am I missing here?

The following line moves all child object from a parent to the first parent in that range:
dict[key].AddRange(items[key].Childs);
The save changes does persist it idd to the database (in this case the memory database). I would not expect the AddRange on a dictionary to change the parent elements of the added child objects to the first parent added on key.

@pgroene It's not doing AddRange on a dictionary. It's doing AddRange on the list contained in the dictionary, and that list is the same instance that is being tracked as a navigation from Parent. The reference to the Parent gets fixed up to be consistent with the parent that now references the children.

Yeah, that idd the case, thanks for sharing that insight! It seems that the code construction was very poor chosen.

authors: ajcvickers pgroene


text:
Updating Navigation Properties Clears IsModified Flag On Other Fields

I am using EF Core 3 with Lazy Loading Proxies and I think I've found a situation where IsModified is not working correctly.
I was trying to use the audit feature of EFPlus (https://entityframework-plus.net/audit) and noticed that some properties I changed was not being audited.
Steps to reproduce

// _db.Entry(myAttachedEntity).Property(x => x.StringProperty).IsModified = false here
myAttachedEntity.StringProperty = "newvalue";
// _db.Entry(myAttachedEntity).Property(x => x.StringProperty).IsModified = true here

// Touching a navigation property on the same entity seems to reset IsModified for the stringproperty
myAttachedEntity.SomeNavProperty = new or same value;

// _db.Entry(myAttachedEntity).Property(x => x.StringProperty).IsModified = false  here
// !!! This is wrong...stringproperty is still changed

Since the audit framework looks to the IsModified property I never got any entries for StringProperty. The weird thing is that the changed values were still persisted to the database correctly. So it feels like either the Proxy object or the original object gets their IsModified value out of sync.
Simply changing the order of operation fixes the property for me:

myAttachedEntity.SomeNavProperty = new value;

// _db.Entry(myAttachedEntity).Property(x => x.StringProperty).IsModified = false here
myAttachedEntity.StringProperty = "newvalue";
// _db.Entry(myAttachedEntity).Property(x => x.StringProperty).IsModified = true here

Further technical details
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: JetBrains Rider

@andrejohansson Please post a small, runnable project/solution or complete code listing that demonstrates the behavior you are seeing.

EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.

source: gharchive/issue

authors: ajcvickers andrejohansson

repo: aspnet/EntityFrameworkCore

license: MIT

license_type: permissive

license_source: github-api


text:
Expression issue with ef core 3.0

seemed same issue with #18333, but seemed not duplicate with #17791(still failed with version 3.1.0-preview1.19506.2)
Core code here:
// Core code
Expression<Func<TestEntity, bool>> whereExpression = e => true;
whereExpression = And(whereExpression, e => e.Id > 0);

var data = db.TestEntities.Where(whereExpression).ToArray(); // break here

exception below:
System.InvalidOperationException: The LINQ expression 'Where<TestEntity>(
    source: DbSet<TestEntity>,
    predicate: (t) => True && Invoke(e => (e.Id > 0), t[TestEntity])
)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|8_0(ShapedQueryExpression translated, <>c__DisplayClass8_0& )
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetEnumerator()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at EFCore3_0ExpressionIssueDemo.Program.Main(String[] args) in C:\projects\test\EFCore3_0ExpressionIssueDemo\Program.cs:line 49

Steps to reproduce
I'd uploaded a demo here
EFCore3_0ExpressionIssueDemo.zip
Further technical details
EF Core version: 3.0.0/3.1.0-preview1.19506.2
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.3.5

Duplicate of #17791
#17791 is fixed in 3.1.0-preview2 not in preview1.

Could you please publish a nuget package? could not found 3.1.0-preview2 even in daily build packages,
and when'll preview 2 release?

authors: WeihanLi smitpatel


text:
Bootstrap 4 Beta deprecation of Bower

https://github.com/twbs/bootstrap/issues/24525#issuecomment-340321193
This issue is linked to bootstrap. Question is, will the templates update as well? This is very unhealthy for newcomers to .NET Core. A viable replacement for the current template should be present.

We have been working to remove Bower from our templates. Let us know if your find any more in https://github.com/aspnet/templating.
cref https://github.com/aspnet/templating/issues/161

authors: natemcmaster nixxholas

repo: aspnet/Home


text:
Moving IHttpContextFactory to Microsoft.AspNet.Http.Abstractions

And implementation to Microsoft.AspNet.Http.

Hi @JunTaoLuo, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;

:shipit:
Why is the ci failing

source: gharchive/pull-request

authors: JunTaoLuo davidfowl dnfclas

repo: aspnet/HttpAbstractions


text:
Promote IFormFile extension methods

One alternative to fix half of #527 :sparkles:

I like it

@khellang squash the commits and I'll merge it. Let's see what breaks!

Done :sparkles:

I guess this warrants an announcement?

authors: davidfowl khellang


text:
Added decoding tests for the FormReader

This is the first step in work to remove char[] allocations from the FormReader

/cc @Tratcher

:shipit:

authors: Tratcher davidfowl


text:
ANCM: APPLICATION::DereferenceApplication is used without using APPLICATION::ReferenceApplication

Attach debugger to w3wp to put following break points

bp aspnetcore!APPLICATION::ReferenceApplication ".echo ReferenceApplication; g"
bp aspnetcore!APPLICATION::DereferenceApplication ".echo DereferenceApplication; g"

Recycle aspnetcore applications

EXPECTED:
The break points hit for both APPLICATION::DereferenceApplication() and APPLICATION::ReferenceApplication().
ACTUAL:
The break point of APPLICATION::DereferenceApplication() is hit but the break point of APPLICATION::ReferenceApplication() is not hit.

@pan-wang could you check if this is done and close it accordingly? Thanks.

@jhkimnew will verify the behavior is as expected.

The repro scenario of this issue is not valid anymore. I did that temporary to find any leak issue. We have better test coverage. So, closing this issue.

authors: jhkimnew muratg

repo: aspnet/IISIntegration


text:
React to ANCM OnAsyncCompletion changes

Fix for #442. Associated issue in ANCM: https://github.com/aspnet/AspNetCoreModule/pull/184
Still need to enable websockets, working on that currently.

@jkotalik,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@davidfowl 🆙 📅

🏓

@davidfowl the native stuff is merged in.

cough cough can you spare a green checkmark 😄

pending https://github.com/aspnet/AspNetCoreModule/pull/212

authors: dnfclas jkotalik


text:
ASP.NET Identity 3 without Roles and using only Claims

Hello,
Is it possible to use ASP.NET Identity 3 in a MVC project only with Claims table and without Roles table?
I am asking this because Role is itself a Claim of type Role so isn't it redundant to have a Roles table?
Thank You

spot on ;p
@blowdart @HaoK @rustd

In a ASP.net Identity on ASP.net MVC 5 is fully possible. In MVC 6 I guess, yes!

IMHO I see to options:
1 - Using only roles and having one roles table;
In this case there would be the RolesStore ...
2 - Using claims, including roles, and having only one claims table.
In this case there would be the ClaimsStore ... Role is a Claim of type Role.
If this results in unwanted complexity why not having only one Claims table and if configuration includes only Roles then Claims table would allow only claims of type Role ...
I just think that having Roles and Claims tables when a Role is a Claim does not make sense.
@alexsandro-xpt:
Do you know where can I find an example of how to set ASP.NET Identity only with Claims?
I was looking and didn't find it ... I just found info on how to add claims on top of roles.
Better documentation for ASP.NET Identity would be great ...
And it would even help people to give better feedback ...

Using Identity abstraction c# classes you can optimize change Identity behavior as you wish, se some links:
http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity
http://www.asp.net/identity/overview/extensibility/implementing-a-custom-mysql-aspnet-identity-storage-provider
http://typecastexception.com/post/2014/02/19/ASPNET-MVC-5-Identity-Implementing-Group-Based-Permissions-Management-Part-I.aspx
http://typecastexception.com/post/2014/02/13/ASPNET-MVC-5-Identity-Extending-and-Modifying-Roles.aspx
Remeber, It's is for Identity compatible with ASP.net MVC 5, I don't know API changes of this new Identity.

:+1:

Moving to RC2 so we can look into it soon.

Any change this to be available on RC2?

Is their any update on this issue?

We should revisit this and see if this is something we want to do in 1.2

Is there a chance you can add an overload the extension method AddIdentity so that you can write:
services.AddIdentity<AppUser>
    .AddEntityFrameworkStores<AppUserCtx>()
    .AddDefaultTokenProviders();

This of course, while you convince yourselves that it is better to roll with Claims only and eliminate the redundancy of Roles.

Yup we plan on doing this for 2.0, tracked via https://github.com/aspnet/Identity/issues/1269

Sure that Roles have no advantages over claims?
https://stackoverflow.com/questions/46910693/how-to-remove-the-role-related-tables-from-asp-net-identity-core-2-0/46910903

authors: HaoK Ponant alexsandro-xpt dcga divega gilmishal leastprivilege mdmoura tugberkugurlu

repo: aspnet/Identity


text:
Restoring library never completes

Functional impact
Restore never finishes
Minimal repro steps
Try this config with VS 16.3.0:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "metisMenu@3.0.4",
"destination": "wwwroot/lib/metisMenu/"
},
{
"provider": "unpkg",
"library": "devextreme@19.1.5",
"destination": "wwwroot/lib/devextreme/"
}
]
}
I already tried to clean the libs before restore, restarted VS and tried again. Always the same - it never ends.
Actual result
Restore never finishes. Stopped restore after 1200 seconds.
First libarary was restored, second not.
Not a single file was in the directory afterwards!
Further technical details
Here is the log of stopping the restore after 20! minutes:
Restore operation started...
Restoring libraries for project ToSec.Presentation
Restoring library metisMenu@3.0.4... (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.css written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.css.map written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.js written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.js.map written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.min.css written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.min.css.map written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.min.js written to destination (ToSec.Presentation)
wwwroot/lib/metisMenu/metisMenu.min.js.map written to destination (ToSec.Presentation)
Restoring library devextreme@19.1.5... (ToSec.Presentation)
Restore operation completed
1 libraries restored in 1219,11 seconds
1 libraries failed to restore

I can confirm this issue. It seems as if UNPKG as library provider is the cause of this problem.
The GUI of Visual Studio sometimes even freezed/crashed when i tried searching for a lib on UNPKG via LibMan.

I tested the same libman.json via the CLI and it worked. It took ages but it executed without any errors.

I confirm that LibMan restore never ends or takes ages 😭 with any provider - #cdnjs, #unpkg, doesn't matter. I would love to use LibMan for client JS libs, but restoring just doesn't seems to complete even withing a week... neither via VS UI nor via CLI. Something is definitely wrong with it in the latest Visual Studio Community 2019 - Version 16.3.0 Preview 2.0.

Any news about this issue? Please help.

I tried this out with the original example (devextreme, which contains 1000+ files).  It took ~75 minutes to download these files (that's about 4 sec per file, in series), and no intermediate logging.  I verified that it was still going by monitoring network traffic and also attaching the debugger (a perf trace wouldn't have shown much, as it's all in the same loop).
Obviously, there's some significant room for improvements here.  However, I haven't seen a case where it never ends (either successfully or with an error).  Has anyone here encountered an actual hang?

The UX issue of not showing any indication of progress has been resolved, and since I've not heard any further reports of this problem I'm going to resolve this issue.

authors: ManuelHaas ddweber dmitry-pavlov jimmylewis wgutierrezr

repo: aspnet/LibraryManager


text:
Trouble building source

After cloning the master branch and running build.cmd, I ran into the following problem:

It might be relevant to note that running it with the compile flag - build.cmd /t:compile - works successfully.
Afterwards I tried to open the solution - Mvc.sln, but found no luck there either as a number of projects are failing to load:

If I try to reload them, the Project file is incomplete. Expected imports are missing. error message shows up.
P.S. I realize that this a fairly annoying issue and you guys have more important ones to deal with.
I appreciate the help very much.

@TKharaishvili can you a list the tests that are failing? I was able to build the repo successfully now, so it might be a machine specific (possibly locale specific) test failure.
See https://github.com/aspnet/AspNetCore/wiki/Building-from-source#building-in-visual-studio--code for steps required to build from source.

@pranavkm rearranging path variables did the trick, I can now build it successfully with VS.
Thank you so much and I hope I didn't cost you too much time. I'm now gonna close the issue.

authors: TKharaishvili pranavkm

repo: aspnet/Mvc


text:
scaffolder doesn't use plural from DbSet

new shorter instructions

Create a RP web app named RazorPagesMovie
Follow these instructions EXCEPT - name the DbSet plural
public DbSet<Movie> Movies { get; set; }

This tutorial had 30K confirming it works until an update was made to change to the plural public DbSet<Movie> Movies { get; set; }
-- what follows is essentially the same instructions
In VS, create a new Razor Pages (RP) app named ContosoUniversity
Create a Models folder. In the Models folder, create a class file named Student.cs and replace the code with the following:
using System;
using System.Collections.Generic;

namespace ContosoUniversity.Models
{
    public class Student
    {
        public int ID { get; set; }
        public string LastName { get; set; }
        public string FirstMidName { get; set; }
        public DateTime EnrollmentDate { get; set; }
    }
}

In the Data folder create a new class file named SchoolContext.cs, and replace the template code with the following code:
using ContosoUniversity.Models;
using Microsoft.EntityFrameworkCore;

namespace ContosoUniversity.Data
{
    public class SchoolContext : DbContext
    {
        public SchoolContext(DbContextOptions<SchoolContext> options) : base(options)
        {
        }

        public DbSet<Student> Students { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

            modelBuilder.Entity<Student>().ToTable("Student");
        }
    }
}

Add SchoolContext to the DI container:
// ADD EF using
// using Microsoft.EntityFrameworkCore;

public void ConfigureServices(IServiceCollection services)
{
    services.AddDbContext<Data.SchoolContext>(options =>
        options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

    services.AddMvc();
}

Open the appsettings.json file and add a connection string as shown in the following code:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=ContosoUniversity1;Trusted_Connection=True;MultipleActiveResultSets=true"
  },
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
    }
  }
}

In the Package Manager Console (PMC), enter the following commands:
Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design -Version 2.0.0
Add-Migration Initial
Update-Database

*Scaffold the model
dotnet aspnet-codegenerator razorpage -m Student -dc SchoolContext -udl -outDir Pages\CU --referenceScriptLibraries
Build the project. You get errors
 error CS1061: 'SchoolContext' does not contain a definition for 'Student' and no extension method 'Student'
Here is the generated code:            _context.Student.Add(Student);
It should be plural
_context.Students.Add(Student);

Related to the issue outlined, the scaffolder also generates singular names for collection properties, which is odd, in my opinion. So instead of
public IList<Student> Students { get; set; }

you get
public IList<Student> Student { get; set; }

And in the Razor Page:
@foreach (var item in Model.Student) {

how do you fix this error from happening, what and where would i change the text?

@philysworld
This issue fixes the problem and has nothing to do with my tutorial.
Globally means in every file where  _context.Student occurs.  If you're using Visual Studio:

Ctrl+Shift+F to bring up the Find and Replace dialog.
Select the Replace in Files tab.
Complete the dialog

am not to sure what page you guys are looking at but i changed in my project every file and coding that had Student to Students and still getting the error.
also for this cmd do i have to input my local database name

Thank you Rick, your tutorials are the best I could find. The last clarification on how to proceed was what I needed. Some of us need as much detail as possible to fully understand the issue and how to fix it.

@Eilon - you mentioned earlier that this was targeted for the March patch.  Can you comment on whether or not that happened?

authors: Rick-Anderson Rolito2009 mikebrind mwhitis philysworld

repo: aspnet/Scaffolding


text:
Add AuthenticationProperties to HandleRequestResult and RemoteFailureContext

#1188 Requires https://github.com/aspnet/HttpAbstractions/pull/889
User state for the login is flown via auth properties, but these aren't available in the OnRemoteFailure event. To add them we need to flow them via the AuthResult.
If this works out then we may use it to flow additional data for #1178. The difference is that the data in #1178 isn't a consistent data structure across handlers.
/cc: @brockallen

@Tratcher,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

More for @anitchanana than for me to review.

bump
I've filled out the tests and addressed some of the ordering issues.

Updated

authors: Tratcher brockallen dnfclas

repo: aspnet/Security


text:
Adjust docker build to use current user ID

Fixes the issue with undeleteable files.

The build worked just fine, but left behind files in .w/ and obj/ that were only deletable by root.

repo: aspnet/Universe


text:
larger sample circuits for benchmarking

This looks like a great project and this is not really an 'issue'! I was just wondering if you had any larger circuit samples of .qasm files of (e.g. QAOA algorithms) to benchmark with?
I have my own tensor network library (see circuit qasm example I've just added here) which uses opt_einsum to perform the contractions.
opt_einsum just uses a greedy approach that is much less sophisticated than e.g. treewidth based approaches for finding optimal paths. It has however, worked pretty well so far, so I would be interested in comparing at what point (number of qubits or graph-connectedness) it falls behind!

Hi @jcmgray,
I like your tensor network visualization a lot! The opt_einsum method may be similar to the greedy stochastic approach we wrote for this library, and you might be interested in reading our paper https://arxiv.org/abs/1709.03636, which has comparisons between the stochastic method and the treewidth approximation algorithm (I wonder if you'll have similar results).
We do have some QAOA algorithm circuits to benchmark with - these are located in the Samples folder - they have strange names like 4regRand30Node...qasm. All of these files implement QAOA maxcut with a single trotterization step (p=1). If you want to generate your own QAOA maxcut qasm files, you can first use the XRegGraphGen (within the main directory of this package) to generate x-regular (meaning you can specify the regularity), random, simply-connected, graph .dgf files, which you then pass as input to a compiled maxcut binary (compiled by running make cut from the main directory. If you don't actually want to run the tensor network contractions (and just want the qasm file), you can put an `exit(0) call on line 274 of maxcut.cpp before compiling it. Please let me know if you have any more questions
Cheers,
Eric Fried

I like your tensor network visualization a lot!

Thanks, yeah it is very helpful when creating/debugging TN code!

The opt_einsum method may be similar to the greedy stochastic approach we wrote for this library, and you might be interested in reading our paper https://arxiv.org/abs/1709.03636, which has comparisons between the stochastic method and the treewidth approximation algorithm (I wonder if you'll have similar results).

Indeed, your paper brought me here. The greedy method is definitely similar, but rather than rank you calculate the total size/memory removed, and always choose the best edge (or one of). To be honest I don't really have a good intuition regarding whether the randomness helps or not so it would be an interesting test.
And thanks very much for the detailed instructions about generating the .qasm files, I shall give that a go at some point soon hopefully.

I couldn't quite get the qasm generation to work - when I run maxcutQAOA (with or without an exit call, and regardless of the number of nodes in the graph) I just get these lines repeated:
...
Parsing nodes from file....
Creating Z measurement on qubit: 0
Creating Z measurement on qubit: 1
Tracing out qubit: 2
Tracing out qubit: 3
Tracing out qubit: 4
Tracing out qubit: 5
Creating qubit 0 in the initial state: |0><0|
Creating qubit 1 in the initial state: |0><0|
Creating qubit 2 in the initial state: |0><0|
Creating qubit 3 in the initial state: |0><0|
Creating qubit 4 in the initial state: |0><0|
Parsing nodes from file....
...

[N.B. I had to #include <memory> and <algorithm> in the graph generator source and change the header comments style from python to c.]
Anyway I wrote a quick python script to generate these files using networkx instead, which may be of use, it's in this gist here.
One final question, in the paper, is the 'single contraction' that is benchmarked:

Tr ( |0><0| |psi><psi| ) ( as would be used in the most likely string estimation)
Or something more complex like <psi| H_maxcut |psi> ?

where |psi> is the state resulting from applying the p=1 unitary circuit in the qasm files.

@jcmgray,
Sorry for the delayed response - I've been working on other projects recently. Thanks for the heads up about the graph generator - I'll fix it. Re QASM generation: let me see if I can split the QAOA circuit creation into a different function (should make things easier I hope). I think what you're seeing is the best angle calculation. For a p=1 circuit on a 3-regular graph, computing the expectation value for H_maxcut takes at most 6 qubits, no matter how many nodes in the graph! The original QAOA paper (section V.) should provide an explanation: https://arxiv.org/abs/1411.4028. Was the circuit you were running 3-regular with a single p step?
The python script is great! I'm sure C++ has similar graph libraries, but I overlooked that when I first wrote this library.
Re. final question: The single contraction that's bench-marked is the most-likely string estimation, given maximized angles to prepare |psi>.

Fixed the compilation errors!

Thanks for the update and fix! I'll give it a go.
And I think I see what you mean regarding the expectation of H_maxcut now - each of the clauses can be computed independently as essentially a local term (with locality depending on p).
In the end I also discovered these circuits which you maybe already know: https://github.com/sboixo/GRCS. My updated 'circuit example' now uses one of these.

authors: jcmgray schuylerfried

repo: aspuru-guzik-group/qtorch


text:
where is my old project?

I was working on a review with ASReview in 2021.
I have a new laptop and installed ASreview again, but now i dont know how to find my project again.

Did you export your old project and store it somewhere?

Ik heb alleen een excel export file met de resultaten.
Maar dacht dat ik gewoon weer bij mijn project kan inloggen om er een update van abtsracts aan toe te voegen. Maar geen ideel hoe ik mijn oude project weer kan openen in ASReviw.  Ik neem aan dat dat nog ergens op een server staat?
Groet
Minne
Prof. Dr. M. (Minne) Fekkes
Bijzonder hoogleraar Sociale Vaardigheden en Weerbaarheid, Universiteit van Amsterdam
Senior wetenschappelijk onderzoeker
TNO Child Health, Leiden
T +31 (0)6 340 565 95
E @.@.>
@.***http://www.tno.nl/
Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden, wordt u verzocht dat aan de afzender te melden en het bericht te verwijderen. TNO aanvaardt geen aansprakelijkheid voor de inhoud van deze e-mail, de wijze waarop u deze gebruikt en voor schade, van welke aard ook, die verband houdt met risico's verbonden aan het elektronisch verzenden van berichten.
From: Rens van de schoot @.>
Sent: woensdag 1 februari 2023 16:02
To: asreview/asreview @.>
Cc: Fekkes, M. (Minne) @.>; Author @.>
Subject: Re: [asreview/asreview] where is my old project? (Issue #1302)
Did you exporthttps://asreview.readthedocs.io/en/latest/manage.html#export-project your old project and store it somewhere?
—
Reply to this email directly, view it on GitHubhttps://github.com/asreview/asreview/issues/1302#issuecomment-1412204197, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2AD5TDBSX73NGQC7TBH4TWVJ3HNANCNFSM6AAAAAAUNY24VQ.
You are receiving this because you authored the thread.Message ID: @.@.>>

If you have used ASReview on your local laptop, the project folder is stored locally and you should open your old laptop to obtain the project folder. If you have used a server installation, please contact your IT department because they might have access to your old folders.
However, If you just want to continue screening, you can simply import the excel file, and ASReview will recognize all the labels you provided in 2021. If you want to merge files, you might be interested in the merge option of Datatools.

authors: Minnefekkes Rensvandeschoot

repo: asreview/asreview


text:
Remove whitespace from column labels

Some users try to load datasets with labels with trailing whitespace. Those labels are not recognized by ASReview.
For example:
title,abstract ,keywords
....

This results in "Abstract not found".
Solution:

Users should remove whitespace.
ASReview trims whitespace on labels.

I had the same issue and this worked for me.

I had the same issue and this worked for me.


text:
[next] La carte des organisations ne fonctionne plus

Décrivez le bug
Les organisations ne s'affichent plus en basculant la vue Organisation vers la carte.
D'après mes investigations, dans cette vue, les ressources ont un objet vide dans l'attribut hasLocation, requis ici côté front : https://github.com/assemblee-virtuelle/archipelago/blob/master/frontend/src/resources/Agent/Actor/Organization/OrganizationList.js#L42-L43
Sur la branche master, il y avait auparavant cette ligne : https://github.com/assemblee-virtuelle/archipelago/blob/master/middleware/config/containers.js#L12 pour déréférencer les locations justement, mais si je comprends bien elle est sensée ne plus être nécessaire depuis la version 0.6.0-alpha.0 du middleware...
Est-ce que ça pourrait être dû à tes modifications sur les blankNodes @srosset81 ?
La suite des investigations dépasse un peu mes compétences si le bug se situe à ce niveau
Comment peut-on corriger ça ? Ca parait plutôt impactant sur l'application comme souci :/

Théorétiquement, depuis https://github.com/assemblee-virtuelle/semapps/pull/1160 les requêtes SPARQL faites depuis le frontend devraient automatiquement déréférencer les blank nodes. Tu devais pouvoir vérifier ça en regardant la requête SPARQL ?
(@BastienSig devrait déployer très prochainement la version next sur https://archipel.assemblee-virtuelle.org, ça permettra de vérifier ça.)

Oui, les versions étaient concordantes.
Je préconiserais de ne pas attendre de déployer l'application en production pour vérifier la présence de ce bug (j'ai d'ailleurs déjà testé sur l'instance de Nantes et j'ai dû rollback)
Voici un scénario de reproduction en local :

Se mettre sur la branche next d'Archipelago
Mettre ses dépendances frontend et middleware à jour via yarn
Démarrer le fuseki local via docker-compose up -d fuseki
Démarrer le frontend et le middleware
Créer une nouvelle organisation en allant ici http://localhost:4000/Organization/create
Ajouter une adresse à l'organisation dans le formulaire d'édition et sauvegarder
Aller sur http://localhost:4000/Organization?view=map et constater que l'organisation ne s'affiche pas

La réponse de la requête Sparql est la suivante.
{
    "@graph": [
        {
            "@id": "_:b0",
            "@type": "http://virtual-assembly.org/ontologies/pair#PostalAddress",
            "addressCountry": "France",
            "addressLocality": "Nantes",
            "addressStreet": "8 Rue Lekain",
            "addressZipCode": "44000"
        },
        {
            "@id": "_:b1",
            "@type": "http://virtual-assembly.org/ontologies/pair#Place",
            "hasPostalAddress": "_:b0",
            "label": "8 Rue Lekain, 44000 Nantes, France",
            "http://virtual-assembly.org/ontologies/pair#latitude": 47.214577,
            "http://virtual-assembly.org/ontologies/pair#longitude": -1.562779
        },
        {
            "@id": "http://localhost:3000/organizations/organisation-test",
            "@type": "http://virtual-assembly.org/ontologies/pair#Organization",
            "created": "2023-11-01T16:27:25.133Z",
            "creator": "http://localhost:3000/users/0828fa12-fd5e-4c1e-9932-7712d6ead9d4",
            "modified": "2023-11-01T16:27:57.563Z",
            "hasLocation": "_:b1",
            "label": "Organisation test"
        }
    ],
    "@context": {
        "addressStreet": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressStreet"
        },
        "addressZipCode": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressZipCode"
        },
        "addressLocality": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressLocality"
        },
        "addressCountry": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressCountry"
        },
        "hasLocation": {
            "@id": "http://virtual-assembly.org/ontologies/pair#hasLocation",
            "@type": "@id"
        },
        "creator": {
            "@id": "http://purl.org/dc/terms/creator",
            "@type": "@id"
        },
        "label": {
            "@id": "http://virtual-assembly.org/ontologies/pair#label"
        },
        "modified": {
            "@id": "http://purl.org/dc/terms/modified",
            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        },
        "created": {
            "@id": "http://purl.org/dc/terms/created",
            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        },
        "longitude": {
            "@id": "http://virtual-assembly.org/ontologies/pair#longitude",
            "@type": "http://www.w3.org/2001/XMLSchema#double"
        },
        "latitude": {
            "@id": "http://virtual-assembly.org/ontologies/pair#latitude",
            "@type": "http://www.w3.org/2001/XMLSchema#double"
        },
        "hasPostalAddress": {
            "@id": "http://virtual-assembly.org/ontologies/pair#hasPostalAddress",
            "@type": "@id"
        },
        "ldp": "http://www.w3.org/ns/ldp#"
    }
}

En comparaison, celle sur la branche master est la suivante :
{
    "@graph": [
        {
            "@id": "_:b0",
            "@type": "pair:PostalAddress",
            "addressCountry": "France",
            "addressLocality": "Nantes",
            "addressStreet": "8 Rue Lekain",
            "addressZipCode": "44000"
        },
        {
            "@id": "_:b1",
            "@type": "pair:Place",
            "hasPostalAddress": "_:b0",
            "label": "8 Rue Lekain, 44000 Nantes, France",
            "pair:latitude": 47.214577,
            "pair:longitude": -1.562779
        },
        {
            "@id": "http://localhost:3000/organizations/organisation-test",
            "@type": "pair:Organization",
            "created": "2023-11-01T16:27:25.133Z",
            "creator": "http://localhost:3000/users/0828fa12-fd5e-4c1e-9932-7712d6ead9d4",
            "modified": "2023-11-01T16:27:57.563Z",
            "hasLocation": "_:b1",
            "label": "Organisation test"
        }
    ],
    "@context": {
        "addressStreet": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressStreet"
        },
        "addressZipCode": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressZipCode"
        },
        "addressLocality": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressLocality"
        },
        "addressCountry": {
            "@id": "http://virtual-assembly.org/ontologies/pair#addressCountry"
        },
        "hasLocation": {
            "@id": "http://virtual-assembly.org/ontologies/pair#hasLocation",
            "@type": "@id"
        },
        "creator": {
            "@id": "http://purl.org/dc/terms/creator",
            "@type": "@id"
        },
        "label": {
            "@id": "http://virtual-assembly.org/ontologies/pair#label"
        },
        "modified": {
            "@id": "http://purl.org/dc/terms/modified",
            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        },
        "created": {
            "@id": "http://purl.org/dc/terms/created",
            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        },
        "longitude": {
            "@id": "http://virtual-assembly.org/ontologies/pair#longitude",
            "@type": "http://www.w3.org/2001/XMLSchema#double"
        },
        "latitude": {
            "@id": "http://virtual-assembly.org/ontologies/pair#latitude",
            "@type": "http://www.w3.org/2001/XMLSchema#double"
        },
        "hasPostalAddress": {
            "@id": "http://virtual-assembly.org/ontologies/pair#hasPostalAddress",
            "@type": "@id"
        },
        "sec": "https://w3id.org/security#",
        "ldp": "http://www.w3.org/ns/ldp#",
        "pair": "http://virtual-assembly.org/ontologies/pair#"
    }
}

La différence visible entre les deux branches sont le nommage des attributs géographiques http://virtual-assembly.org/ontologies/pair#latitude sur next, contre pair:latitude sur master, mais je ne sais pas si ça peut avoir un impact.
Par contre, côté front, l'objet récupéré via useListContext contient un objet vide pour le champ hasLocation. Le bug serait alors côté semantic-data-provider ?

Le bug peut être résolu en ajoutant :
blankNodes: ['pair:hasLocation', 'pair:hasLocation/pair:hasPostalAddress'],

dans le dataModel.list de la ressource Organization, mais ça semble plus palliatif qu'autre chose si les blankNodes sont sensés être trouvés automatiquement :/
Je ferai une PR demain pour proposer cette correction si on n'a pas d'autre piste.

C'est lié à la fonction getEmbedFramequi est appellée par fetchSparqlEndpoints lors du compactage des données. Si on passe l'option list.explicitEmbedOnFraming = false, ça marche. Je regarde plus précisément.

Fixé https://github.com/assemblee-virtuelle/semapps/commit/c3beda1af671c96affe2ce2757c5d92c41caf42b#diff-b739929b6e96b3ef47f22183465b1e9c4c49c2a057f27002bad241af3e23716e
Tu peux t'occuper de faire une release de la branche next (en alpha) si le besoin de déployer est urgent @mguihal ?

Merci de la correction. Mon username sur npmjs c'est mguihal aussi.

repo: assemblee-virtuelle/archipelago


text:
Problème de validation avec MarkdownInput

Si on passe validate={[required()]}, le champ doit bien être rempli pour soumettre le formulaire, mais:

Il n'y a pas une étoile qui apparaît à côté du label
Le label n'apparaît pas en rouge au cas où on essaie de soumettre
Il n'y a pas de message d'erreur rouge qui apparait en-dessous

Pour faire apparaître l'étoile, on peut passer la prop isRequired en plus de validate (isRequired ne suffit pas à bloquer la soumission)

https://github.com/assemblee-virtuelle/semapps/pull/1028


text:
Proposer un container LDP racine

Les specs sur les webACL parlent de "containers racine" (root containers), c'est en lien avec des "users' accounts", donc on voit que c'est pensé plutôt en relation avec un serveur SOLID et un POD.
Le document LDP Primer parle aussi de "root container", et le mets en relation avec un utilisateur:
https://www.w3.org/TR/ldp-primer/#docstore
Cependant, il pourrait être intéressant qu'à la base d'une instance SemApps (donc dans /), on liste tous les containers.
Les containers seraient alors simplement indiqués avec le prédicat ldp:contains.
Cela permettrait à n'importe qui d'explorer le contenu de l'instance, ce qui n'est pas possible pour le moment (si on ne connait pas l'URL des containers, on ne peut rien faire).

++

Proposition d'implémentation:

Lorsqu'on crée un container, l'ajouter automatiquement dans le container parent, si celui-ci existe. (Ou ajouter une option pour ça dans le service ldp.container si on veut pas que ce soit obligatoire)
Si on veut avoir un container racine, il faut le spécifier dans le fichier containers.js.

Proposition d'implémentation:

Lorsqu'on crée un container, l'ajouter automatiquement dans le container parent, si celui-ci existe. (Ou ajouter une option pour ça dans le service ldp.container si on veut pas que ce soit obligatoire)
Si on veut avoir un container racine, il faut le spécifier dans le fichier containers.js.

Questions restantes:

Comment est-ce qu'on affiche les container enfants dans le container parent ? Est-ce qu'on indique seulement l'URL du container, avec le problème qu'on ne sait pas que c'est un sous-container sauf si on va l'explorer ? Si on déréférence le container enfant, ça risque de rendre la lecture difficile.

@scenaristeur tu sais comment c'est géré au niveau d'un pod SOLID ? Les dossiers/containers sont-ils marqués comme tels ou bien est-ce qu'il faut fetcher l'URL pour savoir que c'est un container ?

Questions restantes:

Comment est-ce qu'on affiche les container enfants dans le container parent ? Est-ce qu'on indique seulement l'URL du container, avec le problème qu'on ne sait pas que c'est un sous-container sauf si on va l'explorer ? Si on déréférence le container enfant, ça risque de rendre la lecture difficile.

@scenaristeur tu sais comment c'est géré au niveau d'un pod SOLID ? Les dossiers/containers sont-ils marqués comme tels ou bien est-ce qu'il faut fetcher l'URL pour savoir que c'est un container ?

@srosset81  ca me parait cohérent dans l’ensemble. Avant d'essayer de répondre aux question il y a un point que je ne suis pas sur d'avoir compris. Les Users seraient bien dans un container enfant?

@srosset81  ca me parait cohérent dans l’ensemble. Avant d'essayer de répondre aux question il y a un point que je ne suis pas sur d'avoir compris. Les Users seraient bien dans un container enfant?

@srosset81 sur Solid, les containers sont définis de la sorte : exemple /testcontainer/ dans https://spoggy-test6.solidcommunity.net/public/
container vide  :
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:39:40Z"^^XML:dateTime;
    st:mtime 1611743980.686;
    st:size 4096.

Le même container contenant un fichier bidule.txt
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
@prefix pl: <http://www.w3.org/ns/iana/media-types/text/plain#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    ldp:contains <bidule.txt>;
    st:mtime 1611744089.652;
    st:size 4096.
<bidule.txt>
    a pl:Resource, ldp:Resource;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    st:mtime 1611744089.656;
    st:size 1.

--> definition d'un container :     a ldp:BasicContainer, ldp:Container; +  ldp:contains <bidule.txt>; (pour chaque ressource et container
Le même avec un sous dossier :
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix sou: <sousdossier/>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
@prefix pl: <http://www.w3.org/ns/iana/media-types/text/plain#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    ldp:contains <bidule.txt>, sou:;
    st:mtime 1611744289.299;
    st:size 4096.
<bidule.txt>
    a pl:Resource, ldp:Resource;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    st:mtime 1611744089.656;
    st:size 1.
sou:
    a ldp:BasicContainer, ldp:Container, ldp:Resource;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    st:mtime 1611744289.439;
    st:size 4096.

lui même défini par
@prefix : <#>.
@prefix sou: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.

sou:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    st:mtime 1611744289.439;
    st:size 4096.

@srosset81 sur Solid, les containers sont définis de la sorte : exemple /testcontainer/ dans https://spoggy-test6.solidcommunity.net/public/
container vide  :
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:39:40Z"^^XML:dateTime;
    st:mtime 1611743980.686;
    st:size 4096.

Le même container contenant un fichier bidule.txt
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
@prefix pl: <http://www.w3.org/ns/iana/media-types/text/plain#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    ldp:contains <bidule.txt>;
    st:mtime 1611744089.652;
    st:size 4096.
<bidule.txt>
    a pl:Resource, ldp:Resource;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    st:mtime 1611744089.656;
    st:size 1.

--> definition d'un container :     a ldp:BasicContainer, ldp:Container; +  ldp:contains <bidule.txt>; (pour chaque ressource et container
Le même avec un sous dossier :
@prefix : <#>.
@prefix tes: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix sou: <sousdossier/>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
@prefix pl: <http://www.w3.org/ns/iana/media-types/text/plain#>.

tes:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    ldp:contains <bidule.txt>, sou:;
    st:mtime 1611744289.299;
    st:size 4096.
<bidule.txt>
    a pl:Resource, ldp:Resource;
    terms:modified "2021-01-27T10:41:29Z"^^XML:dateTime;
    st:mtime 1611744089.656;
    st:size 1.
sou:
    a ldp:BasicContainer, ldp:Container, ldp:Resource;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    st:mtime 1611744289.439;
    st:size 4096.

lui même défini par
@prefix : <#>.
@prefix sou: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.

sou:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2021-01-27T10:44:49Z"^^XML:dateTime;
    st:mtime 1611744289.439;
    st:size 4096.

@srosset81 ca me parait cohérent dans l’ensemble. Avant d'essayer de répondre aux question il y a un point que je ne suis pas sur d'avoir compris. Les Users seraient bien dans un container enfant?

Le dossier /users dans pair-ldp-server est déjà un container. Et oui, dans cette optique, il deviendrait un container enfant du container racine, si un tel container est défini.

@srosset81 ca me parait cohérent dans l’ensemble. Avant d'essayer de répondre aux question il y a un point que je ne suis pas sur d'avoir compris. Les Users seraient bien dans un container enfant?

Le dossier /users dans pair-ldp-server est déjà un container. Et oui, dans cette optique, il deviendrait un container enfant du container racine, si un tel container est défini.

Pour les users, au vue des cas d'usages que j'envisage, je dirais oui, les users doivent être traités comme un container enfant de rootContainer accessible (à voir après pour les droits de read/write) afin de pouvoir être liés au ressources, comme par exemple le createur d'une ressource, des groupes d'utilisateurs affectés à une tache...

Pour les users, au vue des cas d'usages que j'envisage, je dirais oui, les users doivent être traités comme un container enfant de rootContainer accessible (à voir après pour les droits de read/write) afin de pouvoir être liés au ressources, comme par exemple le createur d'une ressource, des groupes d'utilisateurs affectés à une tache...

Merci @scenaristeur.
Intéressant que le sous-container soit lui-même défini comme un ldp:Resource en plus de ldp:BasicContainer, ldp:Container, lorsqu'il est lu depuis le container parent, mais pas quand il est lu directement. J'imagine que c'est parce que, dans un container, on ne peut avoir que des ressources ?
En faisant un GET sur https://spoggy-test6.solidcommunity.net/public/testcontainer avec le header Accept: application/ld+json, j'obtiens ça:
[
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:54:00Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/ldp#BasicContainer",
      "http://www.w3.org/ns/ldp#Container"
    ],
    "http://www.w3.org/ns/ldp#contains": [
      {
        "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt"
      },
      {
        "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/"
      }
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744840.932",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "4096",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  },
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:41:29Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/iana/media-types/text/plain#Resource",
      "http://www.w3.org/ns/ldp#Resource"
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744089.656",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "1",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  },
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:44:49Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/ldp#BasicContainer",
      "http://www.w3.org/ns/ldp#Container",
      "http://www.w3.org/ns/ldp#Resource"
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744289.439",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "4096",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  }
]

C'est assez brut comme JSON (ils s'embêtent pas avec du compactage). Je remarque qu'en plus de l'URI du sous-container, il retourne son type, ainsi que sa taille et date de modification, mais j'imagine pas son contenu (ldp:contains)

Merci @scenaristeur.
Intéressant que le sous-container soit lui-même défini comme un ldp:Resource en plus de ldp:BasicContainer, ldp:Container, lorsqu'il est lu depuis le container parent, mais pas quand il est lu directement. J'imagine que c'est parce que, dans un container, on ne peut avoir que des ressources ?
En faisant un GET sur https://spoggy-test6.solidcommunity.net/public/testcontainer avec le header Accept: application/ld+json, j'obtiens ça:
[
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:54:00Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/ldp#BasicContainer",
      "http://www.w3.org/ns/ldp#Container"
    ],
    "http://www.w3.org/ns/ldp#contains": [
      {
        "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt"
      },
      {
        "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/"
      }
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744840.932",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "4096",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  },
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:41:29Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/iana/media-types/text/plain#Resource",
      "http://www.w3.org/ns/ldp#Resource"
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744089.656",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "1",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  },
  {
    "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/",
    "http://purl.org/dc/terms/modified": [
      {
        "@value": "2021-01-27T10:44:49Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
      }
    ],
    "@type": [
      "http://www.w3.org/ns/ldp#BasicContainer",
      "http://www.w3.org/ns/ldp#Container",
      "http://www.w3.org/ns/ldp#Resource"
    ],
    "http://www.w3.org/ns/posix/stat#mtime": [
      {
        "@value": "1611744289.439",
        "@type": "http://www.w3.org/2001/XMLSchema#decimal"
      }
    ],
    "http://www.w3.org/ns/posix/stat#size": [
      {
        "@value": "4096",
        "@type": "http://www.w3.org/2001/XMLSchema#integer"
      }
    ]
  }
]

C'est assez brut comme JSON (ils s'embêtent pas avec du compactage). Je remarque qu'en plus de l'URI du sous-container, il retourne son type, ainsi que sa taille et date de modification, mais j'imagine pas son contenu (ldp:contains)

Et voilà ce que ça donne avec un bon framing:
{
  "@context": {
    "dc": "http://purl.org/dc/terms/",
    "ldp": "http://www.w3.org/ns/ldp#",
    "posix": "http://www.w3.org/ns/posix/stat#"
  },
  "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/",
  "@type": [
    "ldp:BasicContainer",
    "ldp:Container"
  ],
  "dc:modified": {
    "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
    "@value": "2021-01-27T10:54:00Z"
  },
  "ldp:contains": [
    {
      "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt",
      "@type": [
        "http://www.w3.org/ns/iana/media-types/text/plain#Resource",
        "ldp:Resource"
      ],
      "dc:modified": {
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
        "@value": "2021-01-27T10:41:29Z"
      },
      "posix:mtime": {
        "@type": "http://www.w3.org/2001/XMLSchema#decimal",
        "@value": "1611744089.656"
      },
      "posix:size": {
        "@type": "http://www.w3.org/2001/XMLSchema#integer",
        "@value": "1"
      }
    },
    {
      "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/",
      "@type": [
        "ldp:BasicContainer",
        "ldp:Container",
        "ldp:Resource"
      ],
      "dc:modified": {
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
        "@value": "2021-01-27T10:44:49Z"
      },
      "posix:mtime": {
        "@type": "http://www.w3.org/2001/XMLSchema#decimal",
        "@value": "1611744289.439"
      },
      "posix:size": {
        "@type": "http://www.w3.org/2001/XMLSchema#integer",
        "@value": "4096"
      }
    }
  ],
  "posix:mtime": {
    "@type": "http://www.w3.org/2001/XMLSchema#decimal",
    "@value": "1611744840.932"
  },
  "posix:size": {
    "@type": "http://www.w3.org/2001/XMLSchema#integer",
    "@value": "4096"
  }
}

Et voilà ce que ça donne avec un bon framing:
{
  "@context": {
    "dc": "http://purl.org/dc/terms/",
    "ldp": "http://www.w3.org/ns/ldp#",
    "posix": "http://www.w3.org/ns/posix/stat#"
  },
  "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/",
  "@type": [
    "ldp:BasicContainer",
    "ldp:Container"
  ],
  "dc:modified": {
    "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
    "@value": "2021-01-27T10:54:00Z"
  },
  "ldp:contains": [
    {
      "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt",
      "@type": [
        "http://www.w3.org/ns/iana/media-types/text/plain#Resource",
        "ldp:Resource"
      ],
      "dc:modified": {
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
        "@value": "2021-01-27T10:41:29Z"
      },
      "posix:mtime": {
        "@type": "http://www.w3.org/2001/XMLSchema#decimal",
        "@value": "1611744089.656"
      },
      "posix:size": {
        "@type": "http://www.w3.org/2001/XMLSchema#integer",
        "@value": "1"
      }
    },
    {
      "@id": "https://spoggy-test6.solidcommunity.net/public/testcontainer/sousdossier/",
      "@type": [
        "ldp:BasicContainer",
        "ldp:Container",
        "ldp:Resource"
      ],
      "dc:modified": {
        "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
        "@value": "2021-01-27T10:44:49Z"
      },
      "posix:mtime": {
        "@type": "http://www.w3.org/2001/XMLSchema#decimal",
        "@value": "1611744289.439"
      },
      "posix:size": {
        "@type": "http://www.w3.org/2001/XMLSchema#integer",
        "@value": "4096"
      }
    }
  ],
  "posix:mtime": {
    "@type": "http://www.w3.org/2001/XMLSchema#decimal",
    "@value": "1611744840.932"
  },
  "posix:size": {
    "@type": "http://www.w3.org/2001/XMLSchema#integer",
    "@value": "4096"
  }
}

ta question a disparu... mais non, si tu veux avoir son contenu, tu dois faire un get avec son url, mais c'est vrai que ça manque un peu parfois, dans certains cas, ça peut être utile de savoir s'il est vide, ou combien de ressources/ il contient
mais c'est assez compréhensible est proche d'un système de fichier, quand tu listes un folder sur linux/windows, tu n'as pas plus de détails sur les sous dossiers

ta question a disparu... mais non, si tu veux avoir son contenu, tu dois faire un get avec son url, mais c'est vrai que ça manque un peu parfois, dans certains cas, ça peut être utile de savoir s'il est vide, ou combien de ressources/ il contient
mais c'est assez compréhensible est proche d'un système de fichier, quand tu listes un folder sur linux/windows, tu n'as pas plus de détails sur les sous dossiers

ah oui, le framing ça le fait, mais ça donne quoi si tu as une arborescence avec des tonnes de sous-dossiers  et de ressources ? tu ramènes tout ?
Si oui, y'a un moment ou il faut stopper, quand même, d'autant qu'une des ressources pourrait références un container enfant du rootContainer... ;-)

ah oui, le framing ça le fait, mais ça donne quoi si tu as une arborescence avec des tonnes de sous-dossiers  et de ressources ? tu ramènes tout ?
Si oui, y'a un moment ou il faut stopper, quand même, d'autant qu'une des ressources pourrait références un container enfant du rootContainer... ;-)

et ne sont pas ici listés les .acl qui gèrent les droits .meta
exemple : https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt.acl

et ne sont pas ici listés les .acl qui gèrent les droits .meta
exemple : https://spoggy-test6.solidcommunity.net/public/testcontainer/bidule.txt.acl

ta question a disparu... mais non, si tu veux avoir son contenu, tu dois faire un get avec son url, mais c'est vrai que ça manque un peu parfois, dans certains cas, ça peut être utile de savoir s'il est vide, ou combien de ressources/ il contient
mais c'est assez compréhensible est proche d'un système de fichier, quand tu listes un folder sur linux/windows, tu n'as pas plus de détails sur les sous dossiers

Oui ça me semble cohérent, en tout cas ça serait lourd à traiter si on retournait le contenu des containers enfants.
Du coup au niveau de la requête SPARQL qu'on devra faire, il suffira de filter out ldp:contains des resources.

ah oui, le framing ça le fait, mais ça donne quoi si tu as une arborescence avec des tonnes de sous-dossiers et de ressources ? tu ramènes tout ?

Le framing se contente d'ordrer les données fournies, il ne va pas commencer à déréférencer des URLs. Donc si on n'inclut pas le contenu des containers dans la requête, il n'y aura pas de soucis.

ta question a disparu... mais non, si tu veux avoir son contenu, tu dois faire un get avec son url, mais c'est vrai que ça manque un peu parfois, dans certains cas, ça peut être utile de savoir s'il est vide, ou combien de ressources/ il contient
mais c'est assez compréhensible est proche d'un système de fichier, quand tu listes un folder sur linux/windows, tu n'as pas plus de détails sur les sous dossiers

Oui ça me semble cohérent, en tout cas ça serait lourd à traiter si on retournait le contenu des containers enfants.
Du coup au niveau de la requête SPARQL qu'on devra faire, il suffira de filter out ldp:contains des resources.

ah oui, le framing ça le fait, mais ça donne quoi si tu as une arborescence avec des tonnes de sous-dossiers et de ressources ? tu ramènes tout ?

Le framing se contente d'ordrer les données fournies, il ne va pas commencer à déréférencer des URLs. Donc si on n'inclut pas le contenu des containers dans la requête, il n'y aura pas de soucis.

Intéressant que le sous-container soit lui-même défini comme un ldp:Resource en plus de ldp:BasicContainer, ldp:Container, lorsqu'il est lu depuis le container parent, mais pas quand il est lu directement. J'imagine que c'est parce que, dans un container, on ne peut avoir que des ressources ?

dans le premier cas, on lit le parent, et pour lui oui, c'est une ressource
dans le deuxième cas c'est juste un container ;-)
je n'ai jamais vu sur Solid de IndirectContainer ni DirectContainer comme évoqué ici https://www.w3.org/TR/ldp/#ldpc-container

Intéressant que le sous-container soit lui-même défini comme un ldp:Resource en plus de ldp:BasicContainer, ldp:Container, lorsqu'il est lu depuis le container parent, mais pas quand il est lu directement. J'imagine que c'est parce que, dans un container, on ne peut avoir que des ressources ?

dans le premier cas, on lit le parent, et pour lui oui, c'est une ressource
dans le deuxième cas c'est juste un container ;-)
je n'ai jamais vu sur Solid de IndirectContainer ni DirectContainer comme évoqué ici https://www.w3.org/TR/ldp/#ldpc-container

Fait ici https://github.com/assemblee-virtuelle/semapps/pull/642

authors: scenaristeur simonLouvet srosset81

repo: assemblee-virtuelle/semapps


text:
Improve failure message for IterableAssert.contains* when collection size or expected size is 1

Feature summary
See year: 2019 sample in https://truth.dev/comparison#failure-messages
Rule 1) When the size of the expected collection is 1, then there's no point in printing "but some elements were not found".
Of course, they were not found, and the sole element has already been displayed in "to contain.." block.
Rule 2) The same goes for the case when actual collection has size of 1. If it did not match, then there's no point in printing "and others were not expected".
Example
    assertThat(
      Collections.singletonList(
        "year: 2019\n" +
          "month: 7\n" +
          "day: 15\n"
      )
    )
      .containsExactly(
        "year: 2019\n" +
          "month: 6\n" +
          "day: 30\n"
      );

Current output:
java.lang.AssertionError:
Expecting actual:
  ["year: 2019
month: 7
day: 15
"]
to contain exactly (and in same order):
  ["year: 2019
month: 6
day: 30
"]
but some elements were not found: <-- should be removed as per Rule 1
  ["year: 2019
month: 6
day: 30
"]
and others were not expected: <-- should be removed as per Rule 2
  ["year: 2019
month: 7
day: 15
"]

	at org.assertj.core.error.AssertionErrorCreator.assertionError(AssertionErrorCreator.java:93)
	at org.assertj.core.internal.Failures.failure(Failures.java:126)
	at org.assertj.core.internal.Iterables.shouldContainExactlyWithDiffAssertionError(Iterables.java:1150)
	at org.assertj.core.internal.Iterables.assertContainsExactly(Iterables.java:1141)
	at org.assertj.core.api.AbstractIterableAssert.containsExactlyForProxy(AbstractIterableAssert.java:426)
	at org.assertj.core.api.AbstractIterableAssert.containsExactly(AbstractIterableAssert.java:419)

Hi,
I think this issue should be broken down into smaller issues as contains* has many implementations.

authors: NehaDadhich vlsi

repo: assertj/assertj


text:
Update index.js

An empty object from Neo4j returns empty array instead of an object.

Well my change did not solve the problem. It added a new problem.
I will fork and see how it can be solved.

Well, i was wrong. The pull request did solve the problem.

Never mind, i dont know.

license: mit

license_source: bigquery


text:
How to use the schema in request.Body

Hi. Sorry for the simple question. Can you please tell me how I can do the same thing as in the yaml file:
...
requestBody:
   required: true
   content:
     application/json:
         schema:
             $ref: "#/components/schemas/Address"
...

I tried to connect the scheme in the same way as in responses section  but got an error.
registry.registerPath({
 ...
  requestBody: {
    content: {
      "application/json": {
        schema: Schemes.AddressSchema.openapi({
          description: "Object with Address data.",
        }),
      },
    },
  },
  responses: {
    200: {
      mediaType: "application/json",
      schema: Schemes.AddressSchema.openapi({
        description: "Object with Address data.",
      }),
    },
})

Thank you!

Hello again @nazarEnzo
I believe this is what you're looking for:
request: {
    body: schema: Schemes.AddressSchema.openapi({
      description: "Object with Address data.",
    })
  }
   responses: {
     200: {
       mediaType: "application/json",
       schema: Schemes.AddressSchema.openapi({
         description: "Object with Address data.",
       }),
     },

Basically all of body, params, query and headers are passed as an object for the request key. There is some information about it in the Registering a path section of the README.md file. As for the content type we are only supporting application/json for simplicity of usage since this is the most obvious case and we haven't had a the need for anything else as of now.
Thank you for using @asteasolutions/zod-to-openapi

Hello @AGalabov. Thank you for your help!
I tried what you suggested and apparently i am doing something wrong again :)

@AGalabov
It seems to work for me. Is it a good way to reach my goal?
  request: {
    body: z.object({
      schema: Schemes.AddressSchema.openapi({
        description: "Object with Address data.",
      }),
    }),
  },

Everything worked out. Thank you for your help and a great product.

authors: AGalabov nazarEnzo

repo: asteasolutions/zod-to-openapi


text:
PERF403 potential false positive

I enabled --preview with version 0.0.290 and got an interesting hit for PERF403.
Code looks kind of like this:
mapping = {}

animals = ['dog', 'cat', 'bird', 'elephant']
other_mapping = {'snake': 69, 'owl': 42}

for idx, animal in enumerate(animals):
    if animal == 'elephant':
        continue
    mapping[animal] = idx

for animal, idx in other_mapping.items():
    mapping[animal] = idx

print(mapping)

And this will hit PERF403 asking to use dict comprehension where we do
for animal, idx in other_mapping.items():
    mapping[animal] = idx

The only dict comprehension I can imagine is
mapping = {animal: idx for animal, idx in other_mapping.items()}

Which will not do what we want.
Using
mapping.update(other_mapping)

Will work instead. But then in this case isn't the PERF403 hit here a false positive?

I think the rule generally wants you to do mapping.update({animal: idx for animal, idx in other_mapping.items()}) here. We should probably have a separate rule that detects that {animal: idx for animal, idx in other_mapping.items()} is an unnecessary comprehension though, and then further corrects to mapping.update(other_mapping).

It looks like C416 will further correct that to:
mapping.update(dict(other_mapping.items()))

Which is close...

Closing for now as I think mapping.update is the intended solution.

authors: LefterisJP charliermarsh

repo: astral-sh/ruff


text:
[red-knot] implement basic call expression inference

Summary
Adds basic support for inferring the type resulting from a call expression. This only works for the result of call expressions; it performs no inference on parameters. It also intentionally does nothing with class instantiation, __call__ implementors, or lambdas.
Test Plan
Adds a test that it infers the right thing!

Looks like we need to adjust the expected diagnostics in the benchmark.

Looks like this CodSpeed regression is real, but it's expected; we are now looking up the return type of every function called (and apparently doing it twice.) Fixing the double inference part should reduce the size of the regression somewhat.

On closer look, I think a lot of the regression (and why it shows up only in incremental benchmark) is that annotations are deferred in stubs, and now we look up a lot of return types from stubs, which causes us to trigger the infer_deferred_types query on a lot more function definitions, creating more memoized query results that Salsa has to re-validate in an incremental re-check. I still think this is expected and there's not a lot we can do about it, short of finding ways to make Salsa more efficient on new revisions when there are a lot of ingredients to re-validate.

authors: carljm chriskrycho


text:
Cannot install piper-tts due to missing wheel (but pip install works fine)

Repro steps:
uv init
uv pip install piper-tts
Output:
Using CPython 3.12.4 interpreter at: /usr/bin/python
Creating virtual environment at: .venv
Resolved 13 packages in 426ms
error: distribution piper-phonemize==1.1.0 @ registry+https://pypi.org/simple can't be installed because it doesn't have a source distribution or wheel for the current platform
Expected:
piper-tts to be installed correctly.
pip works fine in this case:
... Downloading piper_phonemize-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (25.0 MB)
(maybe using a different Python version somehow?)

Looks like you're using Python 3.10 with pip and 3.12 with uv.

authors: halflings zanieb

repo: astral-sh/uv


text:
vscode trying but failing to use my uv venv

I'm pretty sure this is a bug with vscode's integrated terminal, not uv, but after getting no answers from questions posted at stack overflow and on vscode's github a month ago, figured I'd take a flier on seeing if anyone on uv's side has any advice? I'd love to use uv but this is currently my blocker:
I have the following code in my main.py:
import pymupdf

print(f"pymupdf version is: {pymupdf.__version__}")

I can create a python3.12 environment with pymupdf installed and run it from my (kubuntu24.04) shell without issues, with the following commands (showing shell log after each >command):
>uv --version
uv 0.4.17

>uv init --no-pin-python
Initialized project `askliz2`

>uv venv --python 3.12.6
Using CPython 3.12.6
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

>source .venv/bin/activate
askliz2>uv add pymupdf
Resolved 3 packages in 281ms
Installed 2 packages in 11ms
 + pymupdf==1.24.10
 + pymupdfb==1.24.10

askliz2>python main.py
pymupdf version is: 1.24.10

However, when I launch vscode from this folder with my uv venv activated with code ., and then highlight the line import pymupdf and hit shift+enter to run it in the integrated terminal, I get the following vscode integrated terminal output:
/home/max/askliz2/.venv/bin/python
Python 3.12.6 (main, Sep  9 2024, 22:11:19) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
]633;E;exit()]633;D;0]633;A>>> ]633;B]633;Cimport pymupdf
]633;E;import pymupdf]633;D;0]633;A>>> ]633;B]633;C

Things I've tried so far:

upgrading uv version
hosing and re-installing vscode
installing different python versions (e.g. 3.12.0, 3.12.6, 3.9)
right-clicking to clear terminal and kill terminal and then trying again

When I use the command pallet to select python interpreter, it shows me it's trying to use Python 3.12.6('.venv') ./.venv/bin/python, as it should be, and as the vscode integrated logs above already indicate.
VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Linux x64 6.10.6-061006-generic

What terminal and shell are you using? Is it any different if you create a virtual environment without uv?

thanks for the quick response @zanieb! interesting you can't reproduce. to answer your two questions:

I used warp and konsole (kubuntu built-in terminal) shells to create the venv with uv and then launch vscode (code .) from.
yeah vscode/run-selection worked as expected when I created my venv with python -m venv myenv, from both konsole and warp shells.

Are you using the system or managed Python versions for your environments? Do you see a difference between those? (You can toggle with uv venv --python-preference <only-managed | only-system>)
What does
echo $SHELL
echo $TERM

show?

Have you tried toggling Terminal › Integrated › Shell Integration: Decorations Enabled or Terminal › Integrated › Shell Integration: Enabled? Do you have any custom terminal settings in your settings.json?

Hi @zanieb , sorry for the delay in replying. I started up a fresh new project/folder and am still getting this issue, so want to document the exact set of commands I ran before jumping into vscode and hitting this issue again. then I'll post the output to the commands you asked for...
mkdir askliz_frontend
cd askliz_frontend
uv init

Then added some packages:
 uv add google-generativeai==0.8.3
 uv add streamlit==1.39.0
uv add lancedb==0.15.0
uv tool install ruff

then seeing with ls -a,  that a .venv has already been created, I ran source .venv/bin/activate and code . to hop into vscode, then I highlighted:
def main():
    print("Hello from askliz-frontend!")

...which came populated in hello.py, hit shift+enter to run it in the integrated terminal, and saw the same terminal output as before:
 ~/askliz_frontend  main ?6  /home/max/askliz_frontend/.venv/bin/python                                      ✔  askliz_frontend Py  20:14:49
Python 3.12.6 (main, Sep  9 2024, 22:11:19) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
]633;E;exit()]633;D;0]633;A>>> ]633;B]633;Cdef main():
...     print("Hello from askliz-frontend!")
...

...now to answer your questions:
What does echo $SHELL show?
/usr/bin/zsh

What does echo $TERM show?
xterm-256color

Any shell-integration related settings in my settings.json? I see these:
    "terminal.integrated.shellIntegration.enabled": false,
    "python.terminal.shellIntegration.enabled": true

...I then tried reversing the first from false to true, but no change in terminal behavior, and then changed the second from true to false, but still no change in terminal behavior.
...On Terminal › Integrated › Shell Integration: Decorations Enabled, I'm not quite sure what you mean. I don't have anything related to that in my custom/user settings.json. When I search for 'decorations' in my default settings.json, here's the entry I see that I think is most relevant to what you're asking about:
	// When shell integration is enabled, adds a decoration for each command.
	//  - both: Show decorations in the gutter (left) and overview ruler (right)
	//  - gutter: Show gutter decorations to the left of the terminal
	//  - overviewRuler: Show overview ruler decorations to the right of the terminal
	//  - never: Do not show decorations
	"terminal.integrated.shellIntegration.decorationsEnabled": "both",

I had the same problem migrating from the conda and pip habit. Setting up python plug-ins in vs code The following two configurations may work:
Python: Venv Path
Python: Venv Folders
You can try.


text:
Avoid hangs before exiting CLI

Summary
The resolver sometimes starts HTTP requests that end up not being necessary. When dropping the Tokio runtime before exiting we currently wait for those to complete. This can cause noticeable hangs in the CLI, particularly when the runtime is blocked on slow DNS resolution.
Resolves https://github.com/astral-sh/uv/issues/4599.
Test Plan
This change resolves any reproducible hangs for me locally.

Nice.

authors: charliermarsh ibraheemdev


text:
Don't replace blank spaces in line with new lines

[x] I have tested with the master version of typstfmt and not just typst-lsp
Describe the bug
In a Chinese doc, there are blank spaces between English letters and Chinese characters, howerever, typstfmt replaces these blank spaces in line with new lines.

Please, make "replace blank spaces in line with new lines" an optional.
To Reproduce
Steps to reproduce the behavior:
typstfmt article.typ
git diff article.typ

Hey there :)
thanks for the report, could you provide the string tested and the result after please?

Sure. The string tested
#h(2em) 构建系统（build system），又称构建器，是用来从源代码生成用户可以使用的目标（targets）的自动化工具。目标可以包括库、可执行文件、或者生成的脚本等等。

the result after
#h(2em) 构建系统（build
system），又称构建器，是用来从源代码生成用户可以使用的目标（targets）的自动化工具。目标可以包括库、可执行文件、或者生成的脚本等等。

authors: astrale-sharp ivaquero

repo: astrale-sharp/typstfmt


text:
Sequencer/CometBFT tendermint::validator::Update consensus failures

CometBFT's logic around adding/removing validators is jagged. I can cause consensus failures with a single validator by sending validator updates to remove either the actual validator or non-existing validators. We need to investigate if sending commands that should be no-ops in a multi validator setup also cause consensus failures to make sure the fix covers those plausible cases as well.
In general, we shouldn't be able to cause consensus failures by sending incorrect sudo commands.
Update: can cause consensus failure on multi node network by trying to remove non existing validators as well (!!)

Error from cometBFT on multi node setup when trying to remove non-existing validator:
I[2024-04-23|10:32:20.279] updates to validators                        module=state updates=214B269E0F9119BFAC78884EB05E49801B235140:0
E[2024-04-23|10:32:20.280] CONSENSUS FAILURE!!!                         module=consensus err="failed to apply block; error commit failed for application: changing validator set: failed to find validator 214B269E0F9119BFAC78884EB05E49801B235140 to remove" stack="goroutine 2987 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x64\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine.func2()\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:801 +0x44\npanic({0x105905980?, 0x1400028c200?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x124\ngithub.com/cometbft/cometbft/consensus.(*State).finalizeCommit(0x14000146008, 0x65)\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:1780 +0xacc\ngithub.com/cometbft/cometbft/consensus.(*State).tryFinalizeCommit(0x14000146008, 0x65)\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:1682 +0x26c\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit.func1()\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:1617 +0x8c\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit(0x14000146008, 0x65, 0x0)\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:1655 +0xabc\ngithub.com/cometbft/cometbft/consensus.(*State).addVote(0x14000146008, 0x1400231c820, {0x1400044a120, 0x28})\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:2334 +0x1848\ngithub.com/cometbft/cometbft/consensus.(*State).tryAddVote(0x14000146008, 0x1400231c820, {0x1400044a120?, 0x1054b6264?})\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:2066 +0x28\ngithub.com/cometbft/cometbft/consensus.(*State).handleMsg(0x14000146008, {{0x105ac4c08, 0x1400032e750}, {0x1400044a120, 0x28}})\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:929 +0x300\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0x14000146008, 0x0)\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:836 +0x2c4\ncreated by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 2824\n\t/Users/lily/go/pkg/mod/github.com/cometbft/cometbft@v0.38.6/consensus/state.go:398 +0xf0\n"
I[2024-04-23|10:32:20.281] service stop                                 module=consensus wal=sequencer_testnet/node0/data/cs.wal/wal msg="Stopping baseWAL service" impl=baseWAL
I[2024-04-23|10:32:20.286] service stop                                 module=consensus wal=sequencer_testnet/node0/data/cs.wal/wal msg="Stopping Group service" impl=Group
I[2024-04-23|10:32:22.839] Timed out                                    module=consensus dur=3s height=101 round=0 step=RoundStepPropose

Note the 'changing validator set: failed to find validator' part.

repo: astriaorg/astria


text:
Think about packaging plan and directory structure

Want to be able to pass on updates via pip install without overwriting customized data or scripts.
Will need to make utils and ingest_utils non-editable.  They'll need to make customized scripts for their own stuff which shouldn't be modified by a pip upgrade.
Maybe @dr-rodriguez can add some more thoughts.

The packaging plan also impacts the directory structure. Do we want a src/ or a flat layout?

The dark energy json files should live in data/. anything in the .sqlite file should be there as well

It seems like the utils and ingest_utils modules belong in a separate repo and package which the template depends on. EVERYTHING in the template repo would be customizable.

You can still have a package in the same repo, just that some of the folders are not part of what gets installed with pip. In your pyproject.toml file, for example, you would specify the directory that contains the schema, utils, ingest_utils for purposes of the installation and exclude everything else.
Other things in the repo can be in other directories for sample data, scripts, etc.

Though, thinking on it a bit more- that might conflict with the desire for turning this into a template package.
I do wonder: if we want to make people use ingest/ingest_utils with hard-coded table names, do we really need to have a customizable package? It sounds like we're already deciding for them what tables/columns they are going to be using. They only thing they would be able to pick if a particular table is present or not, but if it's a new table they would need to write their own code to ingest...

We are deciding on some "core" tables but I expect every implementation to have some of their own.
Maybe we start scoping this out too. Let's take the Spectral Type table. That could be our custom table and we should keep that ingest script in the SIMPLE repo.

OK, yea. Deciding on the core tables can also help control the scope. Maybe the ingest package is just on 2-4 core tables and the template defines 1-2 extra custom ones as examples. We don't need to define everything as that is left up to the individual teams.
I'll point out that astrodbkit2 has an example schema (https://github.com/astrodbtoolkit/AstrodbKit2/blob/main/astrodbkit2/schema_example.py) that is provided as a guideline. I will probably want to update that with whatever we do here, since it overlaps with the spirit of this template project. (And as an aside, astrodbkit2 should not be the home for the ingest scripts since it is written to be fully unconstrained).

removed extra files in src (e.g., ea86e8572526321973dec9abd583dc3df2940a86).

moved sqlite file to data folder (a72676369c753d14aa684f3d1537f97fbce1a536)

Brainstorming:
My current thoughts on core tables is that they could be the ones currently included here in the template schema: Publications, Telescopes, Instruments, Modes (could cut this ma, PhotometryFilters (could cut this maybe?), Versions, Regime (could cut this maybe?), Sources, Names, Spectra (could cut this maybe?). This is a good number more than the 2-4 @dr-rodriguez suggested!
So, perhaps this repo could host the few extra tables beyond the ingest package? And then a more pared down repository for the ingest package? It's helpful to have the differentiation between that and astrodbkit2.

If this repo ends up not hosting the pip-installable ingest package, then we needn't have the src/ structure — I just like that structure for packages because it's easier for me to wrap my head around what goes on PyPI. Happy to swap structures!

Brainstorm session (view-only): https://app.mural.co/t/stsciinternal7446/m/stsciinternal7446/1706043059814/0e06fd6ca3ce8ecbefec953a6345323edcf652cc?sender=u9972c6cc42643b1ed44a3448

Update: deleted files that implied Python packaging (b7baf6b0b1aa904f28fb85d03d94d132acfbdde0, fe239d125ef017f6a0bba60f64215ce10c9ff722)

Update: went from src to flat structure (a9fd66fe7cd79f429332b2b56e676aba3ff82323)

Update: and remove action that would've python published (3a5aad7ddfe7252efc0b0a4840cd3be2368be576)

Update: took a stab at an astrodb-scripts repo.

I think we're in a good spot!  Moved graphic to https://github.com/astrodbtoolkit/astrodb_scripts/issues/11

authors: arjunsavel dr-rodriguez kelle

repo: astrodbtoolkit/astrotemplate-db


text:
Prepare KubernetesExecutor PR

Prepare PR (docs / tests?) for this commit: https://github.com/astronomer/airflow/commit/8b9ef97082bcb0750243a605926e654e3fe80469
This adds support for passing in a dictionary of extra labels to append to each pod launched by the kubernetes executor.

I've created ticket:
https://issues.apache.org/jira/browse/AIRFLOW-4159
from @ashb: possibly already eixsts https://issues.apache.org/jira/browse/AIRFLOW-3649
Oh and has a PR https://github.com/apache/airflow/pull/4459

@schnie let's close via https://github.com/apache/airflow/commit/e4bf4879e17051066b5244510d8757463f971d97

authors: andriisoldatenko schnie

repo: astronomer/airflow


text:
Enhance manifest structure validation and add debug logging

This commit introduces several improvements to the manifest file processing logic to ensure robustness and ease of debugging:

Manifest Structure Validation: Added checks to verify that the manifest file contains the expected top-level keys ("nodes", "sources", "exposures").

Data Type Validation: Implemented additional validation to confirm that the "nodes" key maps to a dictionary. This step helps catch issues where the manifest's format deviates from expected structures, particularly in how nodes are represented.

Key Presence Validation: For each node within the manifest, we now verify the presence of essential keys ("resource_type", "original_file_path", "tags", "config").

Description

Related Issue(s)

Breaking Change?

Checklist

[ ] I have made corresponding changes to the documentation (if required)
[ ] I have added tests that prove my fix is effective or that my feature works

@AlgirdasDubickas, we're closing this PR since it's stale. Please feel free to reopen it or create a new one in the future if you have a chance to work on this again - we really appreciate your contribution and would love to see it merged in the future!

authors: AlgirdasDubickas tatiana

repo: astronomer/astronomer-cosmos


text:
Mark EMR Sensor DAG failed if any of the tasks fail

Currently, as seen in the issue the DAG is marked success based
on the status of only the last task even if any of the intermediate tasks
fail. As a result, the master DAG does show the status of the DAG as
successful even though its intermediate tasks fail. This does not reflect
the correct top-level view of the statuses of the DAGs triggered from the master DAG.
The commit adds a PythonOperator task at the end of the DAG to check the
statuses of all of the DAG's tasks and marks the DAG as failed if any of its tasks
fail.
closes: #1059

repo: astronomer/astronomer-providers


text:
pyautogui.click fails (expected LP_Point instance instead of pointer to POINT)

Windows 10, pyautogui 0.9.45, python 2.7
Under some circumstances pyautogui.click(x,y) fails with error
argument 1: <type 'exceptions.TypeError>: expected LP_Point instance instead of pointer to POINT
I can always reproduce the issue in the same location. The coordinates are good. I also tried to put the click into a separate thread, the issue remains though.
Using pycharm I set a breakpoint at the locsation in question, when it stops I can run EvaluateExpression and reproduce the issue each time I evaluate pyautogui.click(5,5). But when I use another project window and try the same there while the first window is still on hold at the breakpoint, I do not get the error. Hence my thinking that threading it would solve it.

I think I got the same problem. I uninstall it by pip uninstall pyautogui and reinstall by pip install pyautogui==0.9.45. Now everything works as before!

I had a similar problem. I had to uninstall pywinauto ( pip uninstall pywinauto ) and roll back to version 0.6.6 ( pip install pywinauto==0.6.6 ). Hope this helps!

The issue still persists when i try to use pystray module along with pyautogui

repo: asweigart/pyautogui


text:
A Question About the Example -- sentence_classifier

I am a new user of texar, when I try one of the examples named "sentence_classifier"(https://github.com/asyml/texar/tree/master/examples/sentence_classifier), I find some problems hard to resolve.
In the example, the language of the data is english however I want to try it in chinese. I just replace the SSTdata with my data.
Here is the form of the data  I use:
2 但是您的所作所为不合适。
1 我觉得这个苹果味道一般。
0 今天终于修正了一个错误。
About the vocab ,I use my own word segmenter for chinese sentence.
The program displays an error:

I guess it is because the size of the batch. So I change the batch size from 50 to 64 in config_kim.py.
Then there is another error appears:

I don't know how to explain it so I hope someone can tell me if I use Texar incorrectly or there are other problems exist.

The error is because the (1) input sentence length < filter size, and (2) the default config does not use padding.
For (1), it looks your data is not tokenized. Texar does not tokenize the text. The input sentence should be like "但是 您 的 所作所为 不 合适", i.e., tokens are separated by whitespaces.
The code should work after fixing (1). To add padding, set the hyperparameter "other_conv_kwargs": {"padding": 'SAME'}, in the dict clas in the config file config_kim.py

Thank you very much ,it really works.
I want to let the program to classify my test sentence so I need to get the result of the class. I change the fetches to fetches = {             "accu": accu,             "pred": pred,             "batch_size": tx.utils.get_batch_size(batch['y'])         }.
I think the key:pred will be the list of the result however the order of the list is messy rather than in the order of the test data. Is there some solution for this problem?

Not quite sure what you meant by "the order of the list is messy". pred should be a Tensor of shape [batch_size].

For example, the label of the test data is [0,1,0,1] and when I print the pred ,it is [1,0,0,1] although the acuuracy is 100%. Maybe it is because the shape of the data is smaller than the size of batch?

accu is computed using pred and the ground-truth labels here.  accu=100% means pred matches ground truth. Can you print out the ground truth to see if it's correct?
To avoid batch smaller than batch_size, you may set allow_smaller_final_batch to False in the data hyperparameters (doc)

I have solved my problem . Thank you very much!

repo: asyml/texar


text:
feat: added changeset configuration

Description
This PR targets adding a changeset configuration for cli and gitHub action for cli.
Related issue(s)

@akshatnema before merging could you change the contibuting.md to add changeset to be added for releases

/rtm

@Souvikns FYI we are shifting to changeset style of releases now.
Discussion Thread: https://asyncapi.slack.com/archives/C07JW8SJK47

@asyncapi/bounty_team

authors: Shurtu-gal aeworxet akshatnema

repo: asyncapi/cli