we have to distinguish between primary/secondary/final energy consumption

Description of the issue
This comes from #390
We need to distinguish between consumption of primary, secondary or final energy.
Ideas of solution
We can implement primary / secondary / final energy consumption as subclasses of consumption(The process of using something and thereby reducing its amount.)
Related definitions mentioned so far:

Primary fuels: Fuels which are extracted directly from natural resources. Examples are: crude oil, natural gas, coals, etc.
Secondary fuels: Fuels manufactured from primary fuels. Examples are: cokes, motor gasoline and coke oven gas, blast furnace gas.
(Glossary of the 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories)

Primary Energy is energy that is contained in fuels within the biosphere and natural reserves, or captured from natural energy flows, in a suitable form for use. Inert matter removed from the extracted fuels and quantities re-injected, flared or vented are not included.
— adapted from United Nations. International Recommendations for Energy Statistics. 154 https://unstats.un.org/unsd/energystats/methodology/ires/ (2018), paragraph 5.10

Secondary Energy is energy that has been converted from primary energy or a different form of secondary energy.
— adapted from United Nations. International Recommendations for Energy Statistics. 154 https://unstats.un.org/unsd/energystats/methodology/ires/ (2018), paragraph 5.10

Final Energy is energy that is delivered to energy consumers for their use.
— adapted from United Nations. International Recommendations for Energy Statistics. 154 https://unstats.un.org/unsd/energystats/methodology/ires/ (2018), paragraph 5.22

Workflow checklist

[ ] I discussed the issue with someone else than me before working on a solution
[ ] I already read the latest version of the workflow for this repository
[ ] The goal of this ontology is clear to me

I am aware that

[ ] every entry in the ontology should have a definition
[ ] classes should arise from concepts rather than from words

First we should agree on which concepts we are talking. I think we need the following two concepts;

The total energy consumption in a geographical region (e.g. a country). This is often labeled as primary energy consumption or gross inland (energy) consumption. See Eurostat glossary.
The energy as delivered to and consumed by the end users (which are e.g. households, industry and transport) within a geographic region. This is concept is usually labeled final energy consumption. See Eurostat glossary.

Some suggestions for definitions that are in line with Eurostat's definition:

Final energy consumption is a quantity value that describes the amount of energy delivered to and consumed by end users.
Gross inland consumption is a  quantity value that describes the total energy consumption in a geographical region (e.g. a country).
Primary energy energy consumption is a quantity value that describes the total energy consumption in a geographical region excluding the non-energetic use of fuels.

We should define these classes as subclasses of consumption, which is a process. Then, we can relate them via has quantity value to smth like an energy amount value or power rate value, which can be used for other purposes aswell.

The definitions rewritten as subclasses of consumption:

Final energy consumption is the consumption of energy delivered to and consumed by end users.
Gross inland consumption is the total consumption of energy in a geographical region (e.g. a country).
Primary energy consumption is the total consumption of energy in a geographical region excluding the non-energetic use of fuels.

Nice definitions!
I would add the alternative term gross inland energy consumption to gross inland consumption (both are used).
And I think the relationship to the energy amount value is helpful and sufficient. This class doesn't exist yet, right?

No, energy amount value doesn't exist yet.
How about An energy amount value is a quantity value that describes an amount of energy.?

Maybe we can add some words to the definition:
An energy amount value is a quantity value that describes a measured or calculated amount of energy for a specific one-dimensional temporal region.

I prefer @sfluegel05's proposal as the inclusion of temporal region in the definition is an unnecessary restriction. An example: If a mass of 1 kg is 1 m above the ground it has a potential energy of 9,81 J, so the energy amount value is 9.81 J. I don't see how that is related to a temporal region.

Okay, let's take Simon's proposal. I was just thinking about energy consumption.

"an energy amount is an amout of energy" is not really a robust definition. I thought about An energy amount value is a quantity value that describes a quantity of energy. which isn't much better. Does anybody have an idea how to replace the secon "amount" in the def? If not, let's take it anyway.

We had a similar problem for the length value. Finally, we defined it as: Length value is a quantity value that has a length unit as unit.
Following that structure we could define: An energy value is a quantity value that has an energy unit as unit.

Should we also include the relationship energy amount value has unit energy unit?
And I noticed that the units I use the most (PJ and TWh) are not included in the energy unit subclasses. Should we include more possible units? If yes I can open a seperate isssue for that.

Should we also include the relationship energy amount value has unit energy unit?

Yes, of course. That directly follows from that definition.

And I noticed that the units I use the most (PJ and TWh) are not included in the energy unit subclasses. Should we include more possible units? If yes I can open a seperate isssue for that.

That is definitely worth it's own issue.

This issue is ready for implementation, isn't it?

I think so.

I can implement. The question is where? consumption is implemented in OEO social and I would implement  energy amount value in OEO physical. If I implement the subclasses of consumption in OEO social, the relation to has quantity value energy amount value is not possible.

energy amount value seems to me like something that should belong in oeo-physical. So I would suggest to move consumption to oeo-shared, since it may be used in different modules.


Lazy loading opacity problem

When you show more than one image e.g. by using "slidesToShow: 2" and also activate lazy loading "lazyLoad: 'ondemand'", then the inline opacity value of the first image is not adapted and stays 0. The image itself is loaded.
Example setting:
$('#xyz').slick({
	infinite: true,
	slidesToShow: 1,
	slidesToScroll: 1,
	arrows: false,
	lazyLoad: 'ondemand',
	responsive: [
	    {
	        breakpoint: 420,
		settings: {
		centerPadding: '40px',
		slidesToShow: 1
	    }
	 },
	 {
		breakpoint: 1025,
		settings: {
		centerPadding: '40px',
		slidesToShow: 2
	 }
	}
      ]
});```

Same Issue here

Might affect #1349 :disappointed_relieved:

@simeydotme sorry, I didn't see that! My fault! And since I didn't mention it yet, slick is by far the best slider I found so far, great work!
I created a JS fiddle here:
https://jsfiddle.net/h1p4d3m5/9/
When you move back & forth some images stay just on opacity: 0 when having 2 slides shown at the same time. Thank you in advance. If you need more information, just let me know!

@colorfool-me , please check out this Fiddle... does it work OK for you?
I noticed that there seemed to be a race-condition for cloned-slides in the lazy-load function.
https://jsfiddle.net/simeydotme/h1p4d3m5/10/

@simeydotme Looks great!

Can you do me a favour and test it on all the browsers/devices you have available, and let me know the results? :smiley:
I will do the same, and if it works OK (I'll test a bunch of responsive options, too) I'll merge it in. :+1:

I checked it on latest Safari, Chrome & Firefox on Mac

And latest Safari on iOS8. All looks fine!

OK, nice.
I checked on Windows:

Chrome
FF
Safari
IE 8-11

and Android

Chrome

All looks good. I'll get to merging :)

Great! Thanks for the quick fix! Keep up the great work!

Applied on master, unminified file.
You'll have to wait for @kenwheeler to bump next version to get the minified files :)


Represent Union Types as Sealed Classes when generating Kotlin models

There is an issue regarding this:
https://pl.kotl.in/P8wl-jOKL
That means for sealed class implementations we should nest them that what we want to avoid, as we tried nesting classes in the past and it was looking cumbersome the nesting level can get very deep

Seems like making the sealed class top-level fixes this:
https://pl.kotl.in/acOr8owf9
Have anything against making them top level classes?

Top level class will lead to class name collision (redeclaration class), as you can't have multiple top level classes with the same names defined in different files. And you can easily run into this scenario if you have multiple queries requesting the same object.

Sealed Classes would improve the dev experience so much.
Could you do it like this example? https://pl.kotl.in/Oda2_p8Oe

That will work for sure, but it leads to another issue: deep nested class names for example for very simple query the name could be 'Query.Data.Hero.Friend.Droid.Episode' . In real world real production Graphql schema is way complicated, especially when it comes to Relay implementation of pagination (edges, node). From our past experience this is not really pleasent to read name of deep nested class that occupies whole screen.

I see. We are importing Episode (or in my Example C oder D) directly. You have to import it like that everytime you use it.
But IMO the typesafty / dev experience is worth it.

Small update about this:
Kotlin 1.5 sealed interfaces might make the codegen easier...
But
... sealed classes do not work anymore if there are GraphQL interfaces in the mix:
union Animal = Cat | Lion | Turtle | Python
interface Pet {
  name: String!
}

query {
  animal {
    ... on Pet {
      name
    }
    ... on Cat {
      meow
    }
    ... on Lion {
      roar
    }
  }
}

So the general case is not easy to model. It might be possible with Fragments as interfaces but it's not easy...

So currently, with a very simple union type with two alternatives, our only option is getting the two classes as individual nullable fields, despite the fact that we might know that one of them can't be null.
How are people handling this currently, just asserting non nullability "!!" on one of them after seeing which one of the two isn't null? This doesn't seem to be in the scope of 3.0.0 either, which just makes it a tiny bit annoying to work with such union types.

@StylianosGakis in 3.x, you can opt-in responseBased codegen in your build.gradle file:
apollo {
  codegenModels.set("responseBased")
}

This will not generate sealed classes just yet but might be a bit closer to what you're looking for. For the query:
query {
  animal {
    ... on Cat {
      meow
    }
    ... on Lion {
      roar
    }
  }
}

It will generate:
interface Animal
class CatAnimal: Animal
class LionAnimal: Animal
class OtherAnimal: Animal

Which you can then use like this:
when (data.animal) {
  is CatAnimal -> // do something with meow
  is LionAnimal -> // do something with roar
  else -> // This is a new type that wasn't known at compile time, do something with it or throw an error
}

I think at this point making Animal a sealed interface should be relatively straightforward. Note that sealed interfaces will not remove the need for a fallback else ->  branch up there as adding new types to an union should be a backward compatible change. But the sealed modifier will express the intent a bit better. We'll add this in 3.x

That is awesome, so much better than what we have right now for sure. Very happy with the approach you took for this!
Looking forward to play around with it. What do you say is the limiting factor making it an opt-in at the moment?

Because responseBased codegen unrolls fragments and generates interfaces for polymorphic types in addition to the implementation, it can generate significantly more code (see https://github.com/apollographql/apollo-android/issues/3144). There's no silver bullet unfortunately. It's either that or the more compact operationBased codegen but that doesn't have all the type information. You can read more about it there: https://github.com/apollographql/apollo-android/blob/dev-3.x/design-docs/Codegen.md

3.0.0-rc01 is now released with sealed interfaces.


Return 'current' cursor

I want to create an absolute link to what is currently the first page returned by https://api.helium.io/v1/oracle/prices,
but I don't know what cursor to pass to ?cursor= because only the previous page's cursor is given.

Sorry, I don't know what this request means.. There is no "currently first page". Oracle prices are returned from the latest block down towards genesis.

Ah, I may have misunderstood how cursor works:
I was under the impression that if I GET https://api.helium.io/v1/oracle/prices?cursor=foo then I would always get the same response body (for foo), is that not true?

Ah, I may have misunderstood how cursor works:
I was under the impression that if I GET https://api.helium.io/v1/oracle/prices?cursor=foo then I would always get the same response body (for foo), is that not true?

that is correct... but the first page can't be that since that page is always growing as blocks come in.. once you get the first page back you have a cursor for the next page where you know all the facts

Gotcha, I've updated the issue title/description with what I actually wanted. Thanks.

Gotcha, I've updated the issue title/description with what I actually wanted. Thanks.

can you explain what you're trying to get out of this? Oracle price at a specific height or an actual list starting at a given block, if so why?

A list starting at a given block, so I can use it in the link on #238, without the relevant blocks eventually drifting off the first page.

A list starting at a given block, so I can use it in the link on #238, without the relevant blocks eventually drifting off the first page.

Understood.. adding this makes edge caches miss more often which is why I'v shied away from them so far for most of the APIs. There may be a way to do this now though.


styled-components example not updated

I start a new project with npx create-remix@latest command and my entry.server.tsx file has 111 lines of code.
Styled-components entry.server.tsx file has only 29 line of code.
Can you update that example?
The exemple code use return new Response("<!DOCTYPE html>" + markup, {
But last remix version use new PassThrough() has new body value:
          const body = new PassThrough();

          responseHeaders.set("Content-Type", "text/html");

          resolve(
            new Response(body, {
              headers: responseHeaders,
              status: didError ? 500 : responseStatusCode,
            })
          );

A pull request updating the example would be more than welcome.
Would be more than glad to help if you have some spare time to take care of it!

I believe the new entry.server file supports React 18 streamining, whereas most of the older examples use React 17 and renderToString.
I'm not sure how simple, if even possible, it is to update the styled-components example to the streaming API.
As you can see, styled components first renders the markup as a string, while collecting styles, then injects those styles into the markup. With streaming, the HTML is already being sent to the client while rendering, so nowhere to inject the styles.
https://github.com/remix-run/examples/blob/872b8baa4e4076b03569e49a424f6cc72ae6637d/styled-components/app/entry.server.tsx#L14-L21

styled-components has an issue about streaming: https://github.com/styled-components/styled-components/issues/3658

@AxelBriche I'm working on a PR to update all examples to comply with our templates.
@kiliman styled-components has an issue about HTML streaming: https://github.com/styled-components/styled-components/issues/3658

@AxelBriche I'm working on a PR to update all examples to be in line with our templates.
@kiliman styled-components has an issue about HTML streaming: https://github.com/styled-components/styled-components/issues/3658

@AxelBriche I'm working on a PR to update all examples to be in line with our templates.
@kiliman styled-components has an issue about HTML streaming: styled-components/styled-components#3658

It seems they have documented how to implement a working example with streaming rendering:
https://styled-components.com/docs/advanced#streaming-rendering
This does not work with a streamed response though.

Any motion on this? We're wondering the exact same thing.
I guess the fallback is to use React 18  with renderToString instead?

I'm migrating away from styled-components, so I can use i library that supports react 18 streaming rendering 🤷♂

@freshollie We would love to get the styled-components example updated to work with React 18

The example that @freshollie gave works, but why did he receive a thumbs down? Is there something wrong?


Store build features, i.e. LIBURSA, BURROW, etc to iroha --version

Debugging some random version of Iroha inside docker image, we found that it should be with URSA, but it reports errors with SHA2 encryption. It would be nice to see details of features enabled for a particular irohad executable, i.e. which flags were used during build.

Solved.


incorrect calculation of potential exposure (missing potential part)

Coverage decreased (-0.02%) to 94.616% when pulling 542204c5d3b099fe50b2de71becd31003f9cb619 on bugfix/potential-exposure-fix into f2ac610a316015aa11e0095a983aab889caff3f5 on release/1.17.2.


Added Support for 1.20 - 1.20.2

Hi, I have adopted your minor code changes, I actually overlooked the version in those places. Yes, I tested it with papermc in versions 1.20, 1.20.1 and 1.20.2.

Big thanks! I'll build and upload it to SpigotMC soon.

Thank you!! ❤


Update FakeMelbourne to 15 qubits

Summary
Fixes #7677
Details and comments
FakeMelbourne has an inconsistency between its properties and its configuration. While reporting 14 qubits, the calibration data is for 15 qubits.As the 15-qubit configuration seems to be the one that the saved calibration data (fetch on March 12th, 2021) reported, this PR extends the coupling map to cover this case. Based on the asymmetry in the cx gates, I deduced the gate direction.

closed in favor of https://github.com/Qiskit/qiskit/pull/10859


ENH: add auto param in filter functions

Currently, classic high pass filtering (i.e. < 0.2 Hz) crashes when uses default, because the transition bandwidth are too large.
As changing the default would create backward incompatibility and differences with MNE-C .
We suggest to add an auto param to adapt the transition bandwidth according to the frequency.
cc @choldgraf @Eric89GXL @jona-sassenhagen

From talking to @rkmaddox, our defaults might be a little extreme. For example, a 10-second FIR with a 0.5 Hz transition to low-pass at e.g. 40 Hz might be a bit overkill. At the very least, adding length='auto', *_trans_bandwidth='auto' could alleviate this a bit, and making them the defaults after a couple of releases might be worth thinking about.

I'll probably dig into this issue at the same time as #3227 (filtering FAQ), hopefully this summer sometime.
I should also look and see what MNE-C does for filtering, since I don't think it's identical to what we do (IIRC our filters are at least longer).

I am fine with auto options if they are well tested before merging

I also like the 'auto' idea, and am very +1 for a guide / tutorial / whatever on filtering. It's one of the issues that's commonly not well understood in neuroscience IME. Happy to give feedback on writing etc.
It would be awesome if there were enough MNE materials to basically fill a semi-advanced undergrad course in neuro data analysis :D

Better defaults would be nice here. Our filter API is a bit cumbersome.

It just occurred to me that we could also give some warnings when people use filters that are too long for the given data, e.g. a FIR filter with too many coefficients or an IIR filter that rings too long (although this might be too expensive to estimate, I'd have to see).

I'd be +1 for that if it doesn't take too much time, though I bet using an
'auto' option as well as including some good documentation on this would be
sufficient.
On Mon, May 23, 2016 at 10:28 AM, Eric Larson<EMAIL_ADDRESS>wrote:

It just occurred to me that we could also give some warnings when people
use filters that are too long for the given data, e.g. a FIR filter with
too many coefficients or an IIR filter that rings too long (although this
might be too expensive to estimate, I'd have to see).
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/mne-tools/mne-python/issues/3239#issuecomment-221038322


Update DropdownMenu tests to remove some dependence on platforms

Keyboard navigation in  DropdownMenu depends on focus instead of platforms.
Updating tests to remove variant: TargetPlatformVariant.desktop()  from keyboard navigation tests.
Pre-launch Checklist

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I signed the CLA.
[x] I listed at least one issue that this PR fixes in the description above.
[x] I updated/added relevant documentation (doc comments with ///).
[x] I added new tests to check the change I am making, or this PR is test-exempt.
[x] I followed the breaking change policy and added Data Driven Fixes where supported.
[x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@bleroux Can you take a look?