Potential merger of two reaction model classes

We agreed that having two interfaces for essentially the same thing is a bit awkward. This PR is a proof-of-concept merger of the separate reaction models from the search and reaction_prediction. It proposes reasonable compromise classes and shows that all the tests can pass with minimal modification if the classes are merged.

[!IMPORTANT]
There are a few issues that would need to be worked out more fully before merging this PR into main, so treat this PR more as a starting point for discussion than changes which should actually be merged in their current form. Therefore this is just a draft PR

Change 1: merging reaction classes
Summary of changes
The two kinds of reaction models use different classes: syntheseus.search.chem.BackwardReaction and syntheseus.interface.models.Prediction (and its subclasses). I merged them into syntheseus.interface.models.Prediction, keeping the features marked in bold:

search
reaction_prediction

names are reactants/product
names are input/output

Reactants are sets
reactants are bags

Metadata is typed dict
metadata is plain dict

has optional identifier field (defaults to None)
no identifier field

scores/probs/etc are in metadata (and not hashed/compared)
explicit fields for score/prob/etc (which are hashed/compared)

As an interim measure, I also augmented the BackwardPrediction a subclass that aliases input/output with product/reactants.
Thoughts on changes
Overall this was a fairly simple merger.
From the search side, the only complication is that reactants were previously assumed not to contain duplicates, but I fixed this by replacing for x in r.reactants with for x in set(r.reactants) in a few places. I could see this potentially causing errors in the future if users are not careful though. If this is a concern, we could create a unique_reactants alias (or something similar).
From the reaction prediction side, the only thing lost is that two identical reactions with different scores or probabilities are now considered equal. However, my understanding is that this functionality was not used so it shouldn't matter.
Although this class was a workable compromise, I would also advocate for the following changes (which are not implemented in this PR):

Move score/probability/etc fields to metadata. They are not used by all models, and the purpose of having a metadata dict was specifically to avoid every reaction object carrying around a bunch of unused attributes filled with None.
I think the class should probably called Reaction instead of Prediction. This name is clearer, and I imagine syntheseus users would expect us to have a Reaction class and find the name "Prediction" unintuitive. At the same time, if this class will be used throughout syntheseus, I think the name "Prediction" is too broad, since syntheseus can be used to predict other things (e.g. entire synthesis routes)

Change 2: merging reaction model classes
Summary of changes
I merged syntheseus.search.reaction_models.BackwardReactionModel into syntheseus.search.interface.models.ReactionModel class. These classes had more differences, which are in the table below. Features which made it into the merged class are in bold.

search
interface (old)

tracks number of calls
no tracking

caches output (1)
no caching

configurable duplicate removal (true by default) (2)
None

Returns list[list[reaction]]
returns PredictionList (3)

no model info
include get_model_info and get_parameters

Call signature is list[mol]
Call signature is list[mol], num_results (4)

Subclasses override _get... method
subclasses override __call__ directly (5)

Elaboration on above:

To handle num_results, the cache keys are now (mol, num_results).
More on this below. I mainly didn't want to change all the tests for search.
There were some typing issues here since I subclasses BackwardPrediction and added some extra methods, so we might need to change the types a bit if we keep this change. It runs fine though.
To handle calls in search I made num_results optional. If not provided it is filled with a model's default_num_results attribute, which I set to 100 by default (let me know if it should be even higher).
This was done to ensure that caching and call counting is done.

Thoughts on changes
Overall this merger had a few pain points but was easier than expected. That being said, there are a few awkward issues:

Separately caching each number of results is inefficient if the output with num_results=N will always match the first N entries of the output with num_results=(N+M). Overall this is probably minor though.
It is unclear to me whether caching will mess up the evaluation script in any way (e.g. via timing). One solution would just be to turn off caching in this script.
Similarly, it is unclear whether duplicate removal will mess up the eval script (but we could just turn it off in that script and call model.reset()). We could avoid this by setting it to False by default, but besides for evaluation I am skeptical that anybody using reaction models would really want the duplicate reactions to be present, no? If you disagree another option would be to do the de-duplication inside the search algorithms.
The return type being a PredictionList creates the need for extra wrapping/unwrapping. Do you think it could be possible to replace it with a plain list?

Reviewing notes
The main changes in the PR are just 1-2 (which each get their own commit). The remainder of the commit is fixing some tests and downstream errors.
There is some refactoring I didn't do: for example, the syntheseus_wrapper stuff is made obsolete by this PR, but I left it in. If we decide to merge this I will of course fix this up and we can re-review the PR properly.
Next steps?
If we like these changes, I can fix it up and do a proper PR. However, since it would almost certainly introduce breaking changes we would probably need to re-version it.

Thanks @AustinT, this looks very promising! Below are some comments on the various issues you discuss.

Interfaces in interface allow duplicate reactants, but search assumes reactants are unique, leading to set(r.reactants) in a few places.

Yes, I recall we decided to allow duplicate reactants to be able to handle stoichiometry, although I'm not sure how common it is for the models to return non-unique reactants (equivalently, how common that is in training data). My hunch is that we should indeed keep the option to have non-unique reactants as you did in your changes (@mrwnmsr may have thoughts on this too). Your proposal to have a unique_reactants property sounds good; it's intuitive and would reduce code duplication.

Two identical reactions with different scores or probabilities are now considered equal.

Sounds fine, I don't think we're ever comparing the prediction objects in single-step code. The deduplication logic in eval_single_step only looks at the reactants themselves, so it implicitly behaves in the way you describe.

Move score/probability/etc to metadata, as they are not used by all models, and the purpose of having a metadata dict was specifically to avoid every reaction object carrying around a bunch of unused attributes filled with None.

SGTM. I'm also not sure if we need all of these bits of metadata, some are probably never set, but we can look into that in a separate PR.

The Prediction class should be called Reaction, as this would be clearer and more specific.

Agreed. The Prediction class was originally made for single-step evaluation, and it was meant to abstract away whether we're predicting the reaction in the forward or backward direction; this is where the input / output naming comes from. In a broader context Reaction sounds more intuitive. There is a slight annoyance related to the typing of the input / output fields, as we assume in the backward direction the product (input) is a single Molecule, whereas in the forward direction there may be several products, so there the type is Bag[Molecule]. Not sure how to best resolve this, but my hunch is that the forward/backward abstractions for models/predictions are too complex given the utility they actually provide; maybe we don't need all this complexity and can just have a Reaction class which carries a bool denoting whether it was predicted in the forward or backward direction.

To handle num_results, the cache keys are now (mol, num_results), which may be redundant if the results for num_results = n are a prefix of the results for num_results = m for n < m.

It would often not be a prefix, as many models use some sort of beam search or reorder the predictions post-hoc. However, the output for num_results = m truncated to n results is probably at least as good of a prediction as the output for num_results = n in most cases, so there would be a bit of redundancy because we'd be simultaneously storing both a "lower quality" and a "higher quality" prediction. But, I don't think that is a problem: in the majority of cases (both in single-step evaluation and in search), num_results would be set to the same value throughout the "lifetime" of a model; I see adding num_results to the cache key as a way to make sure the behaviour is correct in an odd/unusual case, so I wouldn't worry about being a bit suboptimal.

It is unclear whether caching will mess up the evaluation script in some way. One solution would just be to turn off caching in this script.

I think caching should be turned off in single-step evaluation, because it would interfere with timing, and also due to higher memory usage. In fact, I wonder whether caching should really be on by default: if a user loads a model and computes predictions on their dataset, silently caching the outputs may make it seem as if there is a memory leak, as memory would keep increasing while all the data is stored in the model forever. On the other hand, we obviously want caching during search.
Maybe a compromise could be:

caching is off by default, single-step evaluation keeps that
cli/search.py turns caching on by default (this is already the case)
if we want to be extra-safe, we could add a warning in MinimalSearchAlgorithm if the provided reaction model has caching turned off (for users that call the search primitives directly)

Reaction duplicate removal now part of the model.

SGTM. I agree keeping the duplicates is mostly useful for detailed analysis but not so much for actually using the model for making predictions or running search. When adding the tutorial in #54, I did realize how awkward it is that we need a separate utility to call the model without getting duplicates; making this part of the models and on-by-default sounds like a good change.

Effect of duplication removal on the evaluation script.

The single-step eval script already has a skip_repeats flag that controls this. The only difference would be that we would no longer need to handle deduplication in get_results, and instead would pass skip_repeats to the model.

Default value for num_results provided at construction time, set to 100 by default.

Makes sense; for the default, maybe 50 would already be enough (the evaluation script asks for 100 by default to account for deduplication and make sure the top-50 is computed more accurately, but in practice 50 results should be usually enough).

The existence of the PredictionList class creates the need for extra wrapping/unwrapping.

Yes, I think having this class might be a bit overkill. The idea was to allow for attaching metadata that is not specific to a single predicted reaction and rather to the entire list of predictions, e.g. data about the model that made the prediction. If I recall correctly @mrwnmsr was a fan of this idea, but I think in practice we never actually set this metadata, and it does create more "fluff" in how the outputs are extracted (this can be seen in the tutorial notebook too; a lot of attribute accesses are needed just to get the outputs out). I would be happy with this being changed to just a plain list. If in the future we want to attach model-level metadata, we could also do it on top through a separate dataclass, rather than placing it in an object that is always created whenever a model is called.

Bumping the package version.

These changes would indeed be breaking, and if we were already in the 1.* version then the common practice would be to bump to 2.0.0. However, we're in 0.*, which (as far as I know) assumes breaking changes can happen freely, and so the next version could still be 0.* e.g. 0.4.0. We can release 1.0.0 once things stabilize a bit and we're more confident in the API.

Thanks for looking this over @kmaziarz! Overall I think the conclusion from this is that we should go ahead with a merger of some kind. What about the following changes (marking things you already seemed to agree to with ✅ ):

Reaction class:

✅ Rename base class Prediction -> Reaction.
Have reactants/products fields instead of input/output. Whether it was predicted in forwards/backward direction can be put into metadata if desired.
A subclass SingleProductReaction could be used in most of search and reaction prediction code.
✅ Also provides unique_reactants alias
✅ All probabilities/scores/etc go into metadata dict

PredictionList: ✅ we eliminate this class and instead return lists of reactions. @mrwnmsr do you foresee any problems? (we could always subclass list to create a kind of PredictionList if needed)
Unified reaction model:

✅ Call signature contains num_results with sensible default.
✅ Keep de-duplication and caching functionality in the model.
✅ de-duplication enabled by default
✅ cache keys are (mol, num_results) because redundancy shouldn't matter much in practice
✅ caching off by default with a warning in search: this is a reasonable and intuitive compromise. A more complicated option could be None by default, which is set to True/False on the first call depending on whether it is called in a search algorithm. At this time I think that is overkill though and a warning would suffice.

Once merged, bump to next minor version (0.4.0)

If you are happy with this, I think it would be cleanest to execute it in 2 separate PRs: one for the reaction class and one for the reaction model class. I can do this next week.

Have reactants / products fields instead of input / output.

SGTM, we just need to make sure this is properly taken into account in the eval script.

A subclass SingleProductReaction could be used in most of search and reaction prediction code.

How would this subclass work? Would it change the type of products, or would it have a separate product property that asserts there is just one product and then returns it?

Execute it in 2 separate PRs: one for the reaction class and one for the reaction model class.

Sounds good, the two PRs will already be relatively complex, so better not merge them 🙂 Potentially there could even be three sets of changes (an additional one for PredictionList -> list).

A subclass SingleProductReaction could be used in most of search and reaction prediction code.

How would this subclass work? Would it change the type of products, or would it have a separate product property that asserts there is just one product and then returns it?

There doesn't seem to be a clear best option to me. Maybe just changing the type of product is the easiest.

Maybe just changing the type of product is the easiest.

I'm not sure how mypy will react to that, and it doesn't seem to be a good inheritance practice to change the type (as any instance of the subclass should always be a valid instance of the superclass).

Now redundant with the submission of #73.


Does d3.axis support unequal division

I want to achieve the following effect。

can D3.axis achieve？

Please use Stack Overflow tag d3.js to ask for help. Stack Overflow provides a better collaborative forum: thousands of D3-related questions have been asked there, and some answers may be relevant to you.
When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.
If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.
Thank you! 🤗


how do i make a simple class here and make in available in PHP?

any hello world example or README would be nice!
and thanks a lot for this, creating an extension in C is such a pain.

Classes are not yet supported~

请实现


use &CStr everywhere instead of &str

In Rust 1.77.0, C-string literals have been stabilized and can be created with c"foo".
As such, using CStrs are easy to create, and I believe we should aim to be as zero-cost as possible when it comes to our bindings.

Applying format_compact! to a str is a non-zero cost operation, even if the str is small.
My intuition tells be 90% of the time when using &'a str, 'a is 'static.

This would also allow us to unify the APIs that have two functions: one that takes a &str and one that takes a &CStr. There are many functions
that do not even have a c_str equivalent, and this is personally an issue for me.
I also am slightly against the idea of using generics to accept CStr and str. Again, this will make newcomers more likely to use the much less efficient &str everywhere
when it makes no sense to do so.

This used to be &CStr, but from alpha user experience, I noticed it's not ideal and people are too unfamiliar with it. With compact string, the cost has been greatly reduced in most cases and thus it shouldn't be an issue in 99.9% of the cases considering the fact you aren't likely to use names in hot path code, but more likely setup code.
In the future we can consider some sort of Into trait to support both.


NextUI support Vite build?

Describe the bug
Hi @jrgarciadev, I'm using your lib in some projects and it works fine congrats 🎉 . However, in a project built with Vite the build show a blank page.
Steps to reproduce

Create a simple react project with Vite running this command npm init vite@latest <proyect-name>
Install NextUI lib (in my case it was the 1.0.1-alpha.57 version)
Follow this step https://nextui.org/docs/guide/getting-started#setup
Generate a build and serve it on a server

Expected behaviour
The app should be works perfectly
Screenshots
Installation

Error
https://reactjs.org/docs/error-decoder.html/?invariant=130&args[]=object&args[]=

Environment / Context

Device: Desktop
Operating System: Window 11
Browser and version: Microsoft Edge Version 95.0.1020.40

Additional info
Idk, if I forget something let me know.

Hey @dartilesm I'm glad you liked NextUI 🙌🏼, thank you for detailing this, I've followed the same steps and works fine for me, could you please share your node/npm/yarn versions?
Here's a screenshot:

Hey @dartilesm I'm glad you liked NextUI 🙌🏼, thank you for detailing this, I've followed the same steps and works fine for me, could you please share your node/npm/yarn versions?
Here's a screenshot:

@jrgarciadev It's weird 🤔, even before reporting this issue I deployed the repository in vercel and got the same error. Also I tried to follow the same steps but with create-react-app and I had no problems.
npm -v -> 6.14.13
yarn -v -> 1.22.10
node -v -> 14.17.1

You can download the repo here

Hey @dartilesm 🙋🏻♂ the example repo works fine for me too, could you update your npmversion to the version 7.24.1and try again?

@jrgarciadev sorry for the late reply.
I've updated my npm version to 7.24.1 and it's still happening 🤔!

I also deployed it again to vercel, and the problem still happening.
You can visit the app here

In my phone it appears as blank page 😢

Hey @dartilesm could you please try this again using the latest version v1.0.2-alpha.1?

Hi @jrgarciadev Merry Christmas!! Yes, sure I'll try again in few days.

Hey @dartilesm Merry Christmas! 🎄,  don't worry 👍🏻

@jrgarciadev I tried it again and the error changed, but with different message.

Hey @dartilesm  I just released version v1.0.1-beta.2 which includes the solution for this 🙌🏻


Broken link to Git Basics

On page: https://www.git-scm.com/book/en/v2/Getting-Started-Git-Basics
The Git Basics link is: https://www.git-scm.com/book/en/v2/1-git-basics/_git_basics_chapter
The correct link should be:
https://www.git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository

The problem continues throughout the book. I think the variables dont get replaced properly.

I would like to second this issue.

Indeed, it seems there's an extra/1-git-branching/_ added to all links

@schacon, I think this was your doing. Any idea what's going on?

@ben I want to contribute. But I have a question. Is it possible to fix this bug without access to book on atlas platform?

I think this is an issue with this very repository, but I'm not sure where the thing is that takes fresh builds from Atlas and ships them to git-scm.com. Take a look, see if you can figure it out.

The problem still seems to be occurring. On http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes the link to Git Branching https://git-scm.com/book/en/v2/1-git-branching/_git_branching is broken. It seems that the only working version of this topic is on v1 of the book at https://git-scm.com/book/en/v1/Git-Branching

This no longer seems to be an issue and should be closed.


Initial support for transparent proxy injection

This pull request is now managed with CodeReviewHub. Refresh.

If traffic is between two nodes where do we install the proxy ?

Couple of comments inline. Rest of the bpf side changes look good to me.

If traffic is between two nodes where do we install the proxy ?

The proxy runs either just before or after a payload. If the proxy is after, we currently lose the security context.


athena/examples/asr/aishell_sub/run.sh getting config from aishell

For example:
python athena/cmvn_main.py \
    examples/asr/aishell/configs/mpc.json examples/asr/aishell/data/all.csv || exit 1

Shouldn't it read/write stuff from aishell_sub?

Yeah, it a bug.  aishell_sub is to solve the problem that a single GPU does not need to install horovod. but u can move run.sh(aishell_sub) to the aishell to run, and then delete aishell_sub.


Add Option to suppress autoapi Warning Messages during Build

...that way more relevant messages (like from a future link checker, cf. https://github.com/brightway-lca/brightway-documentation/issues/95) would be more visible.

cf. config.html#suppressing-warnings

AutoAPI isn't the problem, it's https://github.com/brightway-lca/brightway-documentation/issues/112.


TypeError: Cannot read properties of undefined (reading 'RecaptchaVerifier')

Bug report
Getting a TypeError when trying to run the basic signInWithPhoneNumber function:
TypeError: Cannot read properties of undefined (reading 'RecaptchaVerifier')
    at Function.new
    (http://localhost:50000/packages/firebase_auth_web/src/interop/auth.dart.lib
    .js:858:263)
    at new
    firebase_auth_web_recaptcha_verifier_factory.RecaptchaVerifierFactoryWeb.new
    (http://localhost:50000/packages/firebase_auth_web/src/firebase_auth_web_rec
    aptcha_verifier_factory.dart.lib.js:167:49)
    at
    firebase_auth_web_recaptcha_verifier_factory.RecaptchaVerifierFactoryWeb.__.
    delegateFor
    (http://localhost:50000/packages/firebase_auth_web/src/firebase_auth_web_rec
    aptcha_verifier_factory.dart.lib.js:77:14)
    at Function.new
    (http://localhost:50000/packages/firebase_auth/firebase_auth.dart.lib.js:663
    :94)
    at login_screen._LoginScreenState.new.<anonymous>
    (http://localhost:50000/packages/flutter_restaurant/view/screens/auth/login_
    screen.dart.lib.js:880:146)
    at Generator.next (<anonymous>)
    at runBody (http://localhost:50000/dart_sdk.js:40666:34)
    at Object._async [as async] (http://localhost:50000/dart_sdk.js:40697:7)
    at
    http://localhost:50000/packages/flutter_restaurant/view/screens/auth/login_s
    creen.dart.lib.js:872:652
    at ink_well._InkResponseState.new.[_handleTap]
    (http://localhost:50000/packages/flutter/src/material/icon_button.dart.lib.j
    s:35805:31)
    at tap.TapGestureRecognizer.new.invokeCallback
    (http://localhost:50000/packages/flutter/src/gestures/recognizer.dart.lib.js
    :196:18)
    at tap.TapGestureRecognizer.new.handleTapUp
    (http://localhost:50000/packages/flutter/src/gestures/tap.dart.lib.js:408:40
    )
    at tap.TapGestureRecognizer.new.[_checkUp]
    (http://localhost:50000/packages/flutter/src/gestures/tap.dart.lib.js:214:12
    )
    at tap.TapGestureRecognizer.new.handlePrimaryPointer
    (http://localhost:50000/packages/flutter/src/gestures/tap.dart.lib.js:160:23
    )
    at tap.TapGestureRecognizer.new.handleEvent
    (http://localhost:50000/packages/flutter/src/gestures/recognizer.dart.lib.js
    :456:16)
    at pointer_router.PointerRouter.new.[_dispatch]
    (http://localhost:50000/packages/flutter/src/gestures/pointer_router.dart.li
    b.js:93:9)
    at
    http://localhost:50000/packages/flutter/src/gestures/pointer_router.dart.lib
    .js:128:26
    at LinkedMap.new.forEach (http://localhost:50000/dart_sdk.js:27705:11)
    at pointer_router.PointerRouter.new.[_dispatchEventToRoutes]
    (http://localhost:50000/packages/flutter/src/gestures/pointer_router.dart.li
    b.js:125:29)
    at pointer_router.PointerRouter.new.route
    (http://localhost:50000/packages/flutter/src/gestures/pointer_router.dart.li
    b.js:117:37)
    at binding$5.WidgetsFlutterBinding.new.handleEvent
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:38
    9:26)
    at binding$5.WidgetsFlutterBinding.new.dispatchEvent
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:37
    2:24)
    at binding$5.WidgetsFlutterBinding.new.dispatchEvent
    (http://localhost:50000/packages/flutter/src/rendering/layer.dart.lib.js:546
    8:13)
    at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately]
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:34
    3:14)
    at binding$5.WidgetsFlutterBinding.new.handlePointerEvent
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:31
    6:43)
    at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue]
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:30
    5:14)
    at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket]
    (http://localhost:50000/packages/flutter/src/gestures/binding.dart.lib.js:29
    5:65)
    at Object.invoke1 (http://localhost:50000/dart_sdk.js:190712:7)
    at _engine.EnginePlatformDispatcher.__.invokeOnPointerDataPacket
    (http://localhost:50000/dart_sdk.js:169575:15)
    at _engine.PointerBinding.__.[_onPointerData]
    (http://localhost:50000/dart_sdk.js:170460:49)
    at http://localhost:50000/dart_sdk.js:170919:28
    at http://localhost:50000/dart_sdk.js:170872:16
    at loggedHandler (http://localhost:50000/dart_sdk.js:170564:11)

Steps to reproduce
Steps to reproduce the behavior:

follow https://firebase.flutter.dev/docs/auth/phone#web-signinwithphonenumber exactly
run the app 'flutter run', and don't forget to setup firebaseConfig for web
See the stack trace when you run the signInWithPhoneNumber function

Expected behavior
It should show the recaptcha widget, but it just throws the exception instead.
Sample project
Example code:
var body = querySelector('body');
DivElement div = new DivElement();
div.id = "recaptcha-div";
body.children.add(div);

FirebaseAuth auth = FirebaseAuth.instance;
ConfirmationResult confirmationResult = await auth.signInWithPhoneNumber('+1<PHONE_NUMBER>', RecaptchaVerifier(
  container: 'recaptcha-div',
  size: RecaptchaVerifierSize.compact,
  theme: RecaptchaVerifierTheme.dark,
));

Additional context
Click To Expand
I should mention that I am importing firebasejs 8.10.0 from the index.html file.
<!DOCTYPE html>
<html>
<head>
  <base href="/">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="">

  <!-- iOS meta tags & icons -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="">
  <link rel="apple-touch-icon" href="icons/Icon-192.png">

  <title></title>
  <link rel="manifest" href="manifest.json">
  <link rel="stylesheet" type="text/css" href="style.css">

  <!--<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  <link rel="icon" href="/favicon.ico" type="image/x-icon">-->

  <link rel="shortcut icon" type="image/png" href="favicon.png"/>

    <!-- // Other stuff -->

    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE"></script>

</head>
<body>
  <script>
    if ('serviceWorker' in navigator) {
      window.addEventListener('flutter-first-frame', function () {
        navigator.serviceWorker.register('flutter_service_worker.js');
        navigator.serviceWorker.register("/firebase-messaging-sw.js");
      });
    }
  </script>
  <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
  <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js"></script>

  <img class="center" src="load.gif" />

  <script>
    // Your web app's Firebase configuration
    // For Firebase JS SDK v7.20.0 and later, measurementId is optional
    var firebaseConfig = {
      apiKey: '...',
      authDomain: '...',
      projectId: '...',
      storageBucket: "...",
      messagingSenderId: '...',
      appId: '...',
      measurementId: "..."
    };

    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
  </script>
  <script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

Flutter doctor
Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.3, on Mac OS X 10.15.4 19E287 darwin-x64,
    locale en-US)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup
      for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with
        is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods.
      To re-install see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.63.2)
[✓] Connected device (1 available)

! Doctor found issues in 3 categories.

^ this is for the web only, so it's not something I have tried on an actual native device yet.

Flutter dependencies
Click To Expand
Dart SDK 2.14.4
Flutter SDK 2.5.3
flutter_restaurant 1.0.1+2

dependencies:
- carousel_slider 3.0.0 [flutter]
- connectivity 3.0.3 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- cupertino_icons 1.0.2
- dio 4.0.0-prev3 [http_parser path]
- firebase_auth 3.3.6 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_auth_web 3.3.7 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core 1.12.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 9.1.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- fluro 2.0.3 [flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_credit_card 0.1.4 [flutter]
- flutter_local_notifications 5.0.0 [flutter flutter_local_notifications_platform_interface platform timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math]
- flutter_stripe 2.0.2 [flutter stripe_android stripe_ios stripe_platform_interface]
- geocoding 2.0.0 [flutter geocoding_platform_interface]
- geolocator 7.0.1 [flutter geolocator_platform_interface geolocator_web]
- get_it 6.0.0 [async collection]
- google_maps_flutter 2.0.3 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface]
- google_maps_flutter_web 0.3.0 [flutter flutter_web_plugins meta google_maps_flutter_platform_interface google_maps stream_transform sanitize_html]
- http 0.13.4 [async http_parser meta path]
- image 3.0.2 [archive meta xml]
- image_picker 0.7.5+2 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface image_picker_for_web]
- intl_phone_number_input 0.7.0+2 [flutter meta libphonenumber_plugin equatable collection]
- path_provider 2.0.1 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- pin_code_fields 7.3.0 [flutter]
- progress_dialog 1.2.4 [flutter]
- provider 5.0.0 [collection flutter nested]
- shared_preferences 2.0.5 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- shimmer 2.0.0-nullsafety.0 [flutter]
- universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io]
- universal_ui 0.0.8 [flutter]
- url_launcher 6.0.2 [flutter url_launcher_platform_interface url_launcher_linux url_launcher_macos url_launcher_windows url_launcher_web]
- url_strategy 0.2.0 [flutter_web_plugins]
- webview_flutter 2.0.2 [flutter]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- archive 3.1.2 [crypto path]
- async 2.8.1 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.3.1
- clock 1.1.0
- collection 1.15.0
- connectivity_for_web 0.4.0 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.2.0 [flutter]
- connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- crypto 3.0.1 [collection typed_data]
- csslib 0.17.0 [source_span]
- equatable 2.0.3 [collection meta]
- fake_async 1.2.0 [clock collection]
- ffi 1.0.0
- file 6.1.0 [meta path]
- firebase_auth_platform_interface 6.1.11 [firebase_core flutter meta plugin_platform_interface]
- firebase_core_platform_interface 4.2.4 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.5.4 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_messaging_platform_interface 2.1.1 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 1.0.4 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- flutter_local_notifications_platform_interface 3.0.0 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.1 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- freezed_annotation 0.14.3 [collection json_annotation meta]
- geocoding_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- geolocator_platform_interface 2.0.0 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.0.1 [flutter flutter_web_plugins geolocator_platform_interface]
- google_maps 5.1.0 [js_wrapping meta]
- google_maps_flutter_platform_interface 2.0.2 [flutter meta plugin_platform_interface stream_transform collection]
- html 0.15.0 [csslib source_span]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image_picker_for_web 2.0.0 [image_picker_platform_interface meta flutter flutter_web_plugins]
- image_picker_platform_interface 2.0.1 [flutter meta http plugin_platform_interface]
- intl 0.17.0 [clock path]
- js 0.6.3
- js_wrapping 0.7.0 [js]
- json_annotation 4.4.0 [meta]
- libphonenumber 2.0.2 [flutter meta]
- libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface]
- libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber]
- libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface]
- matcher 0.12.10 [stack_trace]
- meta 1.7.0
- nested 1.0.0 [flutter]
- path 1.8.0
- path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 2.0.0 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.0 [path_provider_platform_interface meta path flutter ffi win32]
- petitparser 4.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.0 [meta]
- process 4.1.1 [file path platform]
- sanitize_html 2.0.0 [html meta]
- shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.1 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- stripe_android 2.0.2 [flutter]
- stripe_ios 2.0.2 [flutter]
- stripe_platform_interface 2.0.2 [flutter freezed_annotation json_annotation meta plugin_platform_interface]
- term_glyph 1.2.0
- test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timezone 0.7.0-nullsafety.0 [path]
- typed_data 1.3.0 [collection]
- universal_io 2.0.4 [collection crypto meta typed_data]
- url_launcher_linux 2.0.0 [flutter]
- url_launcher_macos 2.0.0 [flutter]
- url_launcher_platform_interface 2.0.2 [flutter plugin_platform_interface]
- url_launcher_web 2.0.0 [url_launcher_platform_interface meta flutter flutter_web_plugins]
- url_launcher_windows 2.0.0 [flutter]
- vector_math 2.1.0
- win32 2.0.4 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.1.1 [collection meta petitparser]

@seanwestfall
For some reason, while running the firebase_auth example app on web, I am getting network error while trying to signInWithPhoneNumber, so I am unable to verify the behavior you reported.
Can you try the plugin's example and see if you still get same error as you reported ?

@darshankawar I am also getting the same error on the example app:
flutter run --web-port 50000
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...             24.0s
This app is linked to the debug service: ws://<IP_ADDRESS>:50684/US-9cIDOAK8=/ws
Debug service listening on ws://<IP_ADDRESS>:50684/US-9cIDOAK8=/ws

💪 Running with sound null safety 💪

🔥  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

An Observatory debugger and profiler on Chrome is available at: http://<IP_ADDRESS>:50684/US-9cIDOAK8=
WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.
Activating Dart DevTools...                                      2,846ms
The Flutter DevTools debugger and profiler on Chrome is available at: http://<IP_ADDRESS>:9100?uri=http://<IP_ADDRESS>:50684/US-9cIDOAK8=
Error: [firebase_auth/network-request-failed] A network error (such as timeout, interrupted connection or unreachable host) has occurred.
    at Object.throw_ [as throw] (http://localhost:50000/dart_sdk.js:5061:11)
    at firebase_auth_web.FirebaseAuthWeb.new.signInWithPhoneNumber (http://localhost:50000/packages/firebase_auth_web/firebase_auth_web.dart.lib.js:337:23)
    at signInWithPhoneNumber.throw (<anonymous>)
    at http://localhost:50000/dart_sdk.js:38645:38
    at _RootZone.runBinary (http://localhost:50000/dart_sdk.js:38515:59)
    at _FutureListener.thenAwait.handleError (http://localhost:50000/dart_sdk.js:33724:33)
    at handleError (http://localhost:50000/dart_sdk.js:34281:51)
    at Function._propagateToListeners (http://localhost:50000/dart_sdk.js:34307:17)
    at _Future.new.[_completeError] (http://localhost:50000/dart_sdk.js:34157:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:50000/dart_sdk.js:34193:31)
    at Object._microtaskLoop (http://localhost:50000/dart_sdk.js:38778:13)
    at _startMicrotaskLoop (http://localhost:50000/dart_sdk.js:38784:13)
    at http://localhost:50000/dart_sdk.js:34519:9

I will continue to investigate.

@seanwestfall
Thanks. If you could provide a minimal reproducible code or a sample app that we can clone directly and run that triggers the error you reported, would be good.

@darshankawar For the previous error, I'm just reporting that I'm getting the same error as you from the main example over at https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/firebase_auth/example
Though, I copied the code from that example and I did actually get a working example of the phone based authentication working, here is a working example of flutterfire phone auth:
https://github.com/seanwestfall/flutterfire_test
Though, I still haven't found why I am getting the original error from this issue. Will update when I know why.

Thanks for the update. I tried running your app, but have been getting some compile errors that I'll check.

I just pulled it down and I didn't get any compiler errors:
flutter clean; flutter build web
╔════════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available!                                     ║
║                                                                            ║
║ To update to the latest version, run "flutter upgrade".                    ║
╚════════════════════════════════════════════════════════════════════════════╝

Running "flutter pub get" in flutterfire_test2...                   3.2s

💪 Building with sound null safety 💪

Compiling lib/main.dart for the Web...                             51.0s

are you using a different version of flutter?
$ flutter --version
Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (4 months ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4

Try adding this import in your index.html file
 <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>

Remove second argument of signInWithPhoneNumber function and add these two lines in your index.html

@darshankawar @chiragpandey15 @ndungudedan So that worked, it now loads the google captcha thing, thanks guys!
Though, I'm curious as to why this works for my previous project, but it isn't necessary for my example project. I might work on looking into this further.
Should we close this issue then?

Thanks for the update. Closing this as resolved.


feat: Remove low-code cursor usage

What
Resolve https://github.com/airbytehq/airbyte-internal-issues/issues/10568
How

add should_be_synced

Review guide

airbyte_cdk/sources/streams/concurrent/cursor.py

User Impact
Can this PR be safely reverted and rolled back?

[ ] YES 💚
[ ] NO ❌

Summary by CodeRabbit
Release Notes

New Features

Enhanced cursor handling capabilities with new methods for determining record synchronization.
Added flexibility in pagination strategy by allowing different cursor types.
Improved record instantiation with additional parameters for better context.
Introduced a stream_name parameter in various components for enhanced traceability.

Bug Fixes

Improved filtering logic to simplify record synchronization checks.
Enhanced error handling in various methods to enforce parameter requirements.

Tests

Updated test cases to align with new filtering logic and cursor handling enhancements.
Refined assertions in tests to reflect changes in method parameters.
Added new test case for evaluating synchronization criteria based on cursor values.
Standardized test scenarios to utilize new StreamSlice representation.
Enhanced clarity in test code by using named parameters for Record instantiation.
Improved test coverage for DatetimeBasedCursor functionality across various scenarios.
Updated tests to reflect the new structure and usage of the Record class.
Added new tests for various components, including error handlers and authenticators, to ensure robust behavior under different configurations.

UPD:
pytest is green, but mypy still raises an error:
airbyte_cdk/sources/declarative/extractors/record_filter.py:80: error: Argument 1 to "should_be_synced" of "PerPartitionWithGlobalCursor" has incompatible type "Mapping[str, Any]"; expected "Record"  [arg-type]
airbyte_cdk/sources/declarative/extractors/record_filter.py:80: error: Argument 1 to "should_be_synced" of "GlobalSubstreamCursor" has incompatible type "Mapping[str, Any]"; expected "Record"  [arg-type]
airbyte_cdk/sources/declarative/extractors/record_filter.py:80: error: Argument 1 to "should_be_synced" of "DatetimeBasedCursor" has incompatible type "Mapping[str, Any]"; expected "Record"  [arg-type]
airbyte_cdk/sources/streams/concurrent/cursor.py:456: error: Returning Any from function declared to return "bool"  [no-any-return]
airbyte_cdk/sources/declarative/requesters/paginators/strategies/stop_condition.py:37: error: Argument 1 to "should_be_synced" of "ConcurrentCursor" has incompatible type "airbyte_cdk.sources.types.Record"; expected "airbyte_cdk.sources.streams.concurrent.partitions.record.Record"  [arg-type]

I guess it is out of scope of current PR to fix this, as we'll have to change throughout all codebase

records: Mapping[str, Any] -> records: Record
merge airbyte_cdk.sources.streams.concurrent.partitions.record.Record && airbyte_cdk.sources.types.Record

@maxi297 , WDYT ?

Can we confirm this hypothesis? We would need a client-side filtering stream with a parent stream for that.

Tested on mailchimp segment_members stream::: got an exception ::
So I see 2 options  here:

Refactor RecordSelector and all related components to make them work with class Record: https://github.com/airbytehq/airbyte-python-cdk/blob/f62c91eccfa658f529b416031ba3cc5ece93c9c6/airbyte_cdk/sources/declarative/extractors/record_selector.py#L84-L88

Use patch listed below to create Record dynamically during the filtering

Index: airbyte_cdk/sources/declarative/extractors/record_filter.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/airbyte_cdk/sources/declarative/extractors/record_filter.py b/airbyte_cdk/sources/declarative/extractors/record_filter.py
--- a/airbyte_cdk/sources/declarative/extractors/record_filter.py	(revision 6842cc40efe287250fb477a7438d6d76dab4cf19)
+++ b/airbyte_cdk/sources/declarative/extractors/record_filter.py	(date<PHONE_NUMBER>725)
@@ -10,7 +10,7 @@
     PerPartitionWithGlobalCursor,
 )
 from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
-from airbyte_cdk.sources.types import Config, StreamSlice, StreamState
+from airbyte_cdk.sources.types import Config, StreamSlice, StreamState, Record

 @dataclass
@@ -77,7 +77,7 @@
         records = (
             record
             for record in records
-            if (self._substream_cursor or self._date_time_based_cursor).should_be_synced(record)
+            if (self._substream_cursor or self._date_time_based_cursor).should_be_synced(Record(data=record, associated_slice=stream_slice))
         )
         if self.condition:
             records = super().filter_records(

Do we plan to initialize Record  as early as possible in our Selector?

I think I don't understand the proposals. It feels like in both case, we would be at risk of having a cursor with a different implementation that doesn't take the type of record. For example, if the cursor is the ConcurrentCursor, calling .should_be_synced(Record(data=record, associated_slice=stream_slice)) as part of record_filter.py would probably break. Let me know if I'm missing something.
So for me right now, the only solutions are:

Break the interface in the declarative package to set types that both declarative and concurrent know (something like def should_be_synced(record_data: Mapping, stream_slice: Mapping)). I don't like that because we are breaking the interface which will be complicated to manage
Updating airbyte_cdk.sources.types.Record to an interface that does not depend on the partition but would fit the needs of the concurrent package. This involves:

Updating record.partition usages in ConcurrentCursor to rely on the slice, not the partition
Updating record.partition usages in ConcurrentReadProcessor so that the record has the stream name (we will need to add the stream name to the record)
Updating the declarative package to pass the stream name to record (I did not see any usage of Record.__init__ in the sources but I would like a double check on that
As the concurrent package should not know about the declarative one, we should probably move the record to a different package but find a way to keep the import from
I think I prefer the second one. It is more changes code wise in the CDK but create less issues in the sources. I'm also fine breaking interfaces in the concurrent framework as we agreed they were experimental until we complete the migration to one CDK.

WDYT?

Removed Record class is not imported/used directly so it should be safe to merge


Downsampling frequencies

I have a MT collection that has no survey id and to downsample frequencies, I needed to add the survey id because the keys for  MT collection are survey_id.station_id and having '0' for survey id meant no string and problem. I got this error:

I have used this code to downsample and add the id:
# with MTCollection() as mc:
     mc.open_collection(r"C:\Users\aivazpourporgous\Documents\MT\CCA\Inversion\CCA_0\edi\lin0_resampled_frequency.h5")
     for filename in edifiles:
        mt_object = MT()
        mt_object.read(filename)
        #mt_object.survey = "downsampled"
        new_frequency = np.logspace(-3, 3, 20)
        new_mt_obj = mt_object.interpolate(new_frequency, f_type="frequency")
        new_mt_obj.survey = "downsampled"
        mc.add_tf(new_mt_obj)
#
#

Now I have two entities for each station one unknown survey id and one downsampled. I added the id to the original mt_object  before making new_mt_obj but result is same.

@SashaAivaz Try again, I just fixed a bug in MTCollection.add_tf.
I updated the add_tf to have arguments add_tf(tf_object, new_survey='new_survey_name', tf_id_extra='interpolated'
The tf_id_extra will add this onto the end of the tf_id which is the transfer function id, usually the same as the station.  If your station and tf_id are "mt01" then if you set tf_id_extra the new tf_id will be "mt01_tf_id_extra", helps organize transfer functions.
But now you should be able to set the survey for your original data and your downsampled data.

@kujaku11 I did installed the updates but it seems it doesn't like any argument for add_tf It gives same error for tf_id_extra.


error when generating crds using status.Conditions

Bug Report
After adding status.Conditions as per the documentation,
I get the following error when generating the crds:
operator-sdk generate crds --verbose
DEBU[0000] Debug logging is set
INFO[0000] Running CRD generator.
github.com/redhat-cop/operator-utils/pkg/apis/example/v1alpha1:-: conflicting types in allOf branches in schema: array vs object
FATA[0000] error generating CRDs from APIs in pkg/apis: error generating CRD manifests: error running CRD generator: not all generators ran successfully

The error message is not generous.
Removing the Conditions field, the generation completes successfully. My status struct is the following:
// MyCRDStatus defines the observed state of MyCRD
// +k8s:openapi-gen=true
type MyCRDStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
	// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html

	status.Conditions `json:",inline"`
}

What did you do?
see above
What did you expect to see?
generation completed successfully
What did you see instead? Under which circumstances?
the error, see above
Environment
operator-sdk version
operator-sdk version: "v0.16.0", commit: "55f1446c5f472e7d8e308dcdf36d0d7fc44fc4fd", go version: "go1.13.8 linux/amd64"

go version:

go version
go version go1.13.6 linux/amd64

Kubernetes version information:

kubectl version
Client Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.8-beta.0", GitCommit:"6c143d35bb11d74970e7bc0b6c45b6bfdffc0bd4", GitTreeState:"archive", BuildDate:"2020-01-02T00:00:00Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.2", GitCommit:"aa10b5b", GitTreeState:"clean", BuildDate:"2020-03-16T18:11:23Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Kubernetes cluster kind:

OpenShift

Are you writing your operator in ansible, helm, or go?

go
Possible Solution
not sure, this seems just like a bug.
Additional context
none.

it shows that is missing the var name. See:
Replace :
status.Conditions json:",inline"``
With
Conditions status.Conditionsjson:"conditions"``

for golang the two notation should be essentially equivalent and as expected I'm getting the same error with:
// MyCRDStatus defines the observed state of MyCRD
// +k8s:openapi-gen=true
type MyCRDStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
	// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html

	Conditions status.Conditions `json:",inline"`
}

See that the Status structure will represent the status metadata in the CRD and it has an invalid value for this scenario. Replace json:",inline" for json:contionals for example.

it worked.


MVP refactoring for funfacts

Refactored FunFacts activity into MVP style.
Changes in FunFactFragment - (i) initialised ButterKnife to get the FAB click-listener working,  (ii) concatenated ".png" to the saved screenshot file name to avoid "Format not supported" while sharing on WhatsApp and other apps.

Hi @Swati4star , the build is failing with the message -> "You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 25.0.1, Android SDK Platform 25].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager."
The build fail might be because of the differences in Android build tools, Android SDK used by the project and Travis environment.

Yes please. Modify the .travis.yml file.


Very slow on Android OS.

I test on both IOS(iPhone 8+) and Android OS(sunmi mobile and huawei) but only IOS works fine.
#edit: I used Framework7 and upgrade it from v1 to v3.
Before upgrade it works fast both ios and android.

I solve the problem ( It's about my images ).


Building frontend activates moc

Something is wrong.
I see in the terminal:
$ dfx deploy frontend
...
Building frontend...

and in the same time have 100% (one core) allocated to moc process.
How is compiling with .moc related to the frontend? At least, why does this building takes enormous time?

In a default project, the frontend has a dependency on the backend.  The call may be to moc --print-deps while building the dependencies graph.
    "frontend": {
      "dependencies": [
        "backend"
      ],

But it seems to happen after backend canisters are already compiled! First it produces some backend warnings and only then starts time-consuming Building frontend.... That's weird.
WARN: .mops/base@0.10.2/src/Principal.mo:80.20-80.32: warning [M0154], field append is deprecated:
`Array.append` copies its arguments and has linear complexity;

WARN: .mops/base@0.10.2/src/Principal.mo:80.20-80.32: warning [M0154], field append is deprecated:
`Array.append` copies its arguments and has linear complexity;

Executing: cargo build --target wasm32-unknown-unknown --release -p ic_eth --locked
    Finished release [optimized] target(s) in 0.20s
Building frontend...

{
  "canisters": {
    "main": {
      "main": "src/backend/main.mo",
      "type": "motoko",
      "dependencies": [
        "order",
        "payments",
        "personhood",
        "CanDBIndex",
        "NacDBIndex",
        "internet_identity",
        "ic_eth"
      ]
    },
    "order": {
      "main": "src/backend/order.mo",
      "type": "motoko"
    },
    "personhood": {
      "main": "src/backend/personhood.mo",
      "type": "motoko",
      "dependencies": ["ic_eth", "CanDBIndex"]
    },
    "frontend": {
      "frontend": {
        "entrypoint": "src/frontend/src/index.html"
      },
      "dependencies": [
        "personhood"
      ],
      "source": [
        "src/frontend/assets",
        "dist/frontend/"
      ],
      "type": "assets"
    },
    "payments": {
      "main": "src/backend/payments.mo",
      "type": "motoko",
      "dependencies": [
        "pst"
      ]
    },
    "pst": {
      "main": "src/backend/pst.mo",
      "type": "motoko"
    },
    "CanDBIndex": {
      "main": "src/storage/CanDBIndex.mo",
      "type": "motoko",
      "dependencies": ["ic_eth"]
    },
    "NacDBIndex": {
      "main": "src/storage/NacDBIndex.mo",
      "type": "motoko",
      "dependencies": ["ic_eth"]
    },
    "CanDBPartition": {
      "main": "src/storage/CanDBPartition.mo",
      "type": "motoko",
      "dependencies": ["ic_eth"]
    },
    "NacDBPartition": {
      "main": "src/storage/NacDBPartition.mo",
      "type": "motoko",
      "dependencies": ["ic_eth"]
    },
    "ic_eth": {
      "type": "rust",
      "candid": "src/ic_eth/ic_eth.did",
      "package": "ic_eth"
    },
    "internet_identity": {
      "type": "custom",
      "candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
      "wasm": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz",
      "shrink": false,
      "remote": {
        "candid": "internet_identity.did",
        "id": {
          "ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
        }
      }
    }
  },
  "ic_eth": {
    "type": "rust",
    "candid": "src/ic_eth/ic_eth.did",
    "package": "ic_eth"
  },
  "defaults": {
    "build": {
      "args": "-fshared-code --actor-idl .dfx/local/lsp",
      "packtool": "mops sources"
    }
  },
  "output_env_file": ".env",
  "version": 1,
  "networks": {
    "local": {
      "bind": "localhost:8000",
      "type": "ephemeral"
    }
  }
}

Right, there is a bug in the prompt. When it shows Building frontend..., it's actually still building backend. You can reproduce this by adding a syntax error in the backend code. The syntax error will show after Building frontend....


feat: add Auto-export to markdown or html from the marimo editor

This adds a new notebook action to turn on "Auto-export to markdown/html" which does so every 5 seconds only if there are changes.

cc @patrick-kidger - I figure you might be the first to want to try this. Once this releases, and if you do try it, could you give us some feedback on the ergonomics. I'd like to figure out if it should be per session (as it is today), CLI arg, User Config, App Config, etc.

Error
Okay, just given this a go! First of all, sadly I'm getting an error in the console when using specifically the HTML auto-exporter:
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File ".../site-packages/starlette/_utils.py", line 77, in collapse_excgroups
  |     yield
  |   File ".../site-packages/starlette/middleware/base.py", line 186, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File ".../site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File ".../site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File ".../site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File ".../site-packages/starlette/applications.py", line 113, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File ".../site-packages/starlette/middleware/errors.py", line 187, in __call__
    |     raise exc
    |   File ".../site-packages/starlette/middleware/errors.py", line 165, in __call__
    |     await self.app(scope, receive, _send)
    |   File ".../site-packages/marimo/_server/api/auth.py", line 216, in __call__
    |     return await super().__call__(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File ".../site-packages/starlette/middleware/sessions.py", line 85, in __call__
    |     await self.app(scope, receive, send_wrapper)
    |   File ".../site-packages/starlette/middleware/base.py", line 185, in __call__
    |     with collapse_excgroups():
    |   File ".../contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File ".../site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    |     raise exc
    |   File ".../site-packages/starlette/middleware/base.py", line 188, in __call__
    |     await response(scope, wrapped_receive, send)
    |   File ".../site-packages/starlette/middleware/base.py", line 223, in __call__
    |     await send({"type": "http.response.body", "body": chunk, "more_body": True})
    |   File ".../site-packages/starlette/middleware/sessions.py", line 83, in send_wrapper
    |     await send(message)
    |   File ".../site-packages/starlette/middleware/errors.py", line 162, in _send
    |     await send(message)
    |   File ".../site-packages/uvicorn/protocols/http/h11_impl.py", line 503, in send
    |     output = self.conn.send(event=h11.Data(data=data))
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File ".../site-packages/h11/_connection.py", line 512, in send
    |     data_list = self.send_with_data_passthrough(event)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File ".../site-packages/h11/_connection.py", line 545, in send_with_data_passthrough
    |     writer(event, data_list.append)
    |   File ".../site-packages/h11/_writers.py", line 65, in __call__
    |     self.send_data(event.data, write)
    |   File ".../site-packages/h11/_writers.py", line 91, in send_data
    |     raise LocalProtocolError("Too much data for declared Content-Length")
    | h11._util.LocalProtocolError: Too much data for declared Content-Length
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File ".../site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File ".../site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File ".../site-packages/marimo/_server/api/auth.py", line 216, in __call__
    return await super().__call__(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../site-packages/starlette/middleware/sessions.py", line 85, in __call__
    await self.app(scope, receive, send_wrapper)
  File ".../site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
  File ".../contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File ".../site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    raise exc
  File ".../site-packages/starlette/middleware/base.py", line 188, in __call__
    await response(scope, wrapped_receive, send)
  File ".../site-packages/starlette/middleware/base.py", line 223, in __call__
    await send({"type": "http.response.body", "body": chunk, "more_body": True})
  File ".../site-packages/starlette/middleware/sessions.py", line 83, in send_wrapper
    await send(message)
  File ".../site-packages/starlette/middleware/errors.py", line 162, in _send
    await send(message)
  File ".../site-packages/uvicorn/protocols/http/h11_impl.py", line 503, in send
    output = self.conn.send(event=h11.Data(data=data))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../site-packages/h11/_connection.py", line 512, in send
    data_list = self.send_with_data_passthrough(event)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../site-packages/h11/_connection.py", line 545, in send_with_data_passthrough
    writer(event, data_list.append)
  File ".../site-packages/h11/_writers.py", line 65, in __call__
    self.send_data(event.data, write)
  File ".../site-packages/h11/_writers.py", line 91, in send_data
    raise LocalProtocolError("Too much data for declared Content-Length")
h11._util.LocalProtocolError: Too much data for declared Content-Length

LMK if you need library versions etc. and I can provide some debug information.
On to ergonomics/UX.
Getting lost in the options
I think I'm getting rather lost amongst the various export or conversion options. In the top menu there is:
≡
    Download
        Download ...
        Download ...
        Print ...
        Download ...
        Download ...
    Auto-export
        Auto Export ...
        Auto Export ...

So:

It's not really obvious to me what the difference between 'Download' and 'Auto-export' is meant to be. Can we standardise terminology on just 'export' or just 'download'?
Can we provide parity between the two tabs (HTML/MD/PDF/...), so that it's clear that one is a flavour of functionality of the other?
There's also a fairly rogue 'Print' hiding in there.

As I understand it, 'app view' (down in the bottom right) is also basically equivalent to HTML. So:

again there seem to be two kinds of terminology.
an equivalent option is hiding out in a totally different part of the UI.
this seems functionally equivalent to 'download this HTML and then immediately open it again' -- amongst the export options above, why is HTML privileged?
this flavour has an additional vertical/grid/slides toggle. Why does this approach get these extra (unexportable?) options?

In summary, there's all kinds of semi-related options hiding out in unstructured places; I think these could do with a tidy-up.
Easy to forget to autoexport
If I close and reopen then my autoexport seems to be lost. Easy to forget to turn it back on! I at least frequently close and re-open the same file rather a lot. I'd suggest making the value here be written in to the .py file so that it is persistent. (IIUC this is what you refer to as App-level config.)
In addition a user-level config for e.g. 'auto export to HTML on all new files' might be desirable, in case I have a default preference, with a CLI-level override in either direction. (marimo edit --auto-export=html foo.py; marimo edit --no-auto-export=md bar.py) But fewer strong feelings on that / if nothing else IMO implementing that is a lower-priority item.

thanks for the feedback (and stacktrace)! I will make some improvements.

@patrick-kidger p.s. the reason for lack of parity between Download and Auto-download is because the auto-download must happen on the backend. We cannot auto-download on the frontend since the browser throws a popup and gets mad (for spam protection), so the missing ones are the download types that happen all on the frontend