How to use the restructured-text docstring style?

Hi,
Thanks for the awesome package!
Trying to use mkdocstrings (version 0.14.0) with the restructured-text docstring style.
Here's my configuration:
::: path.to.Class
    handler: python
    selection:
          docstring_style: restructured-text

Getting: mkdocstrings.handlers.base.CollectionError: 'restructured-text'
Also tried docstring_style: rest and others with no luck.
Trying to follow this documentation, it is not clear how to make this work.

It's indeed docstring_style: restructured-text, and yes it's not clear in the docs, I'll mark this as "docs to improve".
:::: path.to.Class
    handler: python
    selection:
      docstring_style: restructured-text

Hi @pawamoy, thanks for the quick response.
Still no luck. For this input (with collections.Counter to make sure it's not a package thing):
::: collections.Counter
    handler: python
    selection:
      docstring_style: google

Everything works.
For this input:
::: collections.Counter
    handler: python
    selection:
      docstring_style: resturctured-text

The output is:
ERROR   -  mkdocstrings.extension: Could not collect 'collections.Counter'
ERROR   -  Error reading page 'api.md': 'resturctured-text'
[E 210216 22:31:25 ioloop:907] Exception in callback <bound method LiveReloadHandler.poll_tasks of <class 'livereload.handlers.LiveReloadHandler'>>
    Traceback (most recent call last):
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\tornado\ioloop.py", line 905, in _run
        return self.callback()
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\livereload\handlers.py", line 69, in poll_tasks
        filepath, delay = cls.watcher.examine()
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\livereload\watcher.py", line 119, in examine
        func()
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\serve.py", line 136, in builder
        build(config, live_server=live_server, dirty=dirty)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\build.py", line 271, in build
        _populate_page(file.page, config, files, dirty)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\build.py", line 171, in _populate_page
        page.render(config, files)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\structure\pages.py", line 175, in render
        self.content = md.convert(self.markdown)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\core.py", line 264, in convert
        root = self.parser.parseDocument(self.lines).getroot()
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 90, in parseDocument
        self.parseChunk(self.root, '\n'.join(lines))
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 105, in parseChunk
        self.parseBlocks(parent, text.split('\n\n'))
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 123, in parseBlocks
        if processor.run(parent, blocks) is not False:
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\extension.py", line 154, in run
        xml_element = self.process_block(identifier, block, heading_level)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\extension.py", line 193, in process_block
        data: Any = handler.collector.collect(identifier, selection)
      File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\handlers\python.py", line 220, in collect
        raise CollectionError(error)
    mkdocstrings.handlers.base.CollectionError: 'resturctured-text'
ERROR   -  Exception in callback <bound method LiveReloadHandler.poll_tasks of <class 'livereload.handlers.LiveReloadHandler'>>
Traceback (most recent call last):
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\tornado\ioloop.py", line 905, in _run
    return self.callback()
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\livereload\handlers.py", line 69, in poll_tasks
    filepath, delay = cls.watcher.examine()
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\livereload\watcher.py", line 119, in examine
    func()
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\serve.py", line 136, in builder
    build(config, live_server=live_server, dirty=dirty)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\build.py", line 271, in build
    _populate_page(file.page, config, files, dirty)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\commands\build.py", line 171, in _populate_page
    page.render(config, files)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocs\structure\pages.py", line 175, in render
    self.content = md.convert(self.markdown)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\core.py", line 264, in convert
    root = self.parser.parseDocument(self.lines).getroot()
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 90, in parseDocument
    self.parseChunk(self.root, '\n'.join(lines))
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 105, in parseChunk
    self.parseBlocks(parent, text.split('\n\n'))
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\markdown\blockparser.py", line 123, in parseBlocks
    if processor.run(parent, blocks) is not False:
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\extension.py", line 154, in run
    xml_element = self.process_block(identifier, block, heading_level)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\extension.py", line 193, in process_block
    data: Any = handler.collector.collect(identifier, selection)
  File "C:\Users\user\.conda\envs\my_project\lib\site-packages\mkdocstrings\handlers\python.py", line 220, in collect
    raise CollectionError(error)
mkdocstrings.handlers.base.CollectionError: 'resturctured-text'

VERSIONS

package
version
where from

markdown
3.3.3              pyh9f0ad1d_0
conda-forge

markupsafe
2.0.0a1                  pypi_0
pypi

mkdocs
1.1.2                      py_0
conda-forge

mkdocs-material
6.2.8                    pypi_0
pypi

mkdocs-material-extensions 1.0.1
pypi_0
pypi

mkdocstrings
0.14.0
pyhd8ed1ab_0

Maybe it's only in your comment, but you wrote resturctured-text instead of restructured-text. In any case, it shouldn't raise an error like this one. Could you set up a public repository on GitHub where the issue happens? I can't seem to reproduce locally.

Does the issue happen locally? Do you happen to have an old pytkdocs version installed on your system? Try deactivating and reactivating your venv, or running hash -r while activated. mkdocstrings spawns a pytkdocs process and I think it's using the wrong one (an old version).

Oh! It was indeed a typo @pawamoy. Thanks for your help! It not works. Feel free to close the ticket.

Great! Closing :slightly_smiling_face:

Note that docs should probably explicitly mention restructured-text as an option :)


Download mempool-bound transactions, log their transaction::Verifier results to stdout prior to mempool storage

We can take our block syncer and copy/paste that into a transaction downloader stream, and for a first pass, make sure that all the transcations we download pass  the TransactionVerifier, and log the result to stdout.
Later, those passing transactions will be inserted into our mempool via a call to the MempoolService

We can also just verify PushTransactions, but I'm not sure how common they are.


Swap arguments order to keep consistency with docs

It would be nice if the argument order of the RichUtils.handleKeyCommand method were always command followed by editorState to keep consistency with the handleKeyCommand prop of the Editor module as seen in the API reference.
  handleKeyCommand(command, editorState) {
    const newState = RichUtils.handleKeyCommand(editorState, command) // Update this to (command, editorState) for sake of clarity.
    if (newState) {
      this.onChange(newState);
      return 'handled';
    }
    return 'not-handled';
  }

Hi Bruno,
Can I work on this one?

Mind that this is a bit trickier than it seems, because it is a breaking change and would have to be done in such a way that doesn't impact current usage of RichUtils.handleKeyCommand

I take back the good first issue 😅

@claudiopro Wasn't we supposed to just swap the order of the arguments here https://github.com/facebook/draft-js/blob/a08a8fa5d18b13dc4381f81b08adfbbc5b023166/src/model/modifier/RichTextEditorUtil.js#L54 and then swap the function's parameters everywhere it's called?

The issue is that this change breaks all consuming projects that import RichTextEditorUtil, and would require some coordination. All in all, I don't think this is a good first issue and while valuable for cleanliness of the API, it has a negative cost/benefit ratio. I hope this makes more sense @ahmedkrmn ?

@claudiopro Thanks for the clarification!


Message: Access to invalidated Collection object

What happened?
When executing the deletion process of a record (via the Atlas platform or the process on the device), the message described is returned.
Here we have updated to realm version: ^0.10.0+rc, but the error occurs since version 8
As you can see below, the records exist in the Atlas console, in Realm Studio and are being presented in the interface.
To interconnect the interface with the data, we are using the flutter_bloc lib.
[ATLAS - CONSOLE]

[REALM STUDIO]

[UI]

Realm Flutter Version: realm: ^0.10.0+rc
Repro steps
When deleting a record via the atlas platform or any action taken on the device, the following error is generated:
[GENERATED ERROR]

Version
Flutter Version: Flutter 3.7.0 / Dart: Dart 2.19.0
What Atlas Services are you using?
Atlas Device Sync
What type of application is this?
Flutter Application
Client OS and version
Android 8 / Android 10 / Android 13 (emulator) / Iphone 12 / Iphone 14
Code snippets
abstract class ActivitiesDataSource {
  Future<ActivitiesModel> saveActivity({required ActivitiesModel activitiesModel});
  Stream<List<ActivitiesModel>> getActivitiesList({required String rdoId});
  Future<bool> deleteActivity({required ActivitiesModel activitiesModel});
}

// usage with injectable/getIt
@LazySingleton(as: ActivitiesDataSource)
class ActivitiesDataSourceImpl implements ActivitiesDataSource {
  final Realm _realm;

  ActivitiesDataSourceImpl(@Named(DatabaseConstants.rdo) this._realm);

  @override
  Future<ActivitiesModel> saveActivity({required ActivitiesModel activitiesModel}) async {
    try {
      Activities activitiesRealm = activitiesModel.toRealm();
      _realm.write<Activities>(() => _realm.add<Activities>(activitiesRealm, update: true));
      return Future.value(ActivitiesModel.fromRealm(activitiesRealm));
    } on RealmException catch (exception) {
      throw rdo_exception.RealmException(message: exception.message);
    }
  }

  // find results by params
  final StreamController<List<ActivitiesModel>> _streamController = StreamController<List<ActivitiesModel>>.broadcast();
  @override
  Stream<List<ActivitiesModel>> getActivitiesList({ required String rdoId }) async* {
    try {
      final Realm _realm = getIt<Realm>(instanceName: DatabaseConstants.rdo);

      final RealmResults<Activities> activitiesChange = _realm.query<Activities>(r'rdo_id = $0', [ObjectId.fromHexString(rdoId)]);
      final activitiesModelList = activitiesChange.changes.map((event) => event
          .results
          .toList()
          .map((activity) => ActivitiesModel.fromRealm(activity))
          .toList());

      activitiesModelList.listen((event) {
        _streamController.add(event);
      });
    } on RealmException catch (exception) {
      _streamController.addError(
        rdo_exception.RealmException(message: exception.message),
      );
    }
    yield* _streamController.stream;
  }

  // delete proccess
  @override
  Future<bool> deleteActivity({required ActivitiesModel activitiesModel}) {
    try {
      final Activities? realmActivities = _realm.find<Activities>(ObjectId.fromHexString(activitiesModel.idModel!));

      if (realmActivities == null) {
        throw const rdo_exception.RealmException(message: ErrorMessageConstants.objectNotFound);
      }

      _realm.write(() => _realm.delete<Activities>(realmActivities));

      return Future.value(true);
    } on RealmException catch (exception) {
      throw rdo_exception.RealmException(message: exception.message);
    }
  }
}

// BLOC
@injectable
class ActivitiesListBloc
    extends Bloc<ActivitiesListEvent, ActivitiesListState> {
  final GetActivitiesListUsecase _getActivitiesListUsecase;

  ActivitiesListBloc({
    required GetActivitiesListUsecase getActivitiesListUsecase,
  })  : _getActivitiesListUsecase = getActivitiesListUsecase,
        super(const ActivitiesListState()) {
    on<ActivitiesGetListEvent>(_getActivitiesList);
  }

  Future<void> _getActivitiesList(
      ActivitiesGetListEvent event, Emitter<ActivitiesListState> emit) async {
    emit(state.copyWith(status: StatusEnum.loading));

    await emit.forEach<List<ActivitiesEntity>>(
        _getActivitiesListUsecase(ParamsActivitiesList(rdoId: event.rdoId)),
        onData: (activities) => state.copyWith(
              status:
                  activities.isNotEmpty ? StatusEnum.success : StatusEnum.empty,
              activitiesList: activities,
            ),
        onError: (_, __) => state.copyWith(status: StatusEnum.failure));
  }
}

Stacktrace of the exception/crash you're getting
[log] onError(ActivitiesListBloc, RealmException: Error code: 7 . Message: Access to invalidated Collection object, #0      _RealmCore.throwLastError.<anonymous closure>
package:realm/…/native/realm_core.dart:119
#1      using
package:ffi/src/arena.dart:124
#2      _RealmCore.throwLastError
package:realm/…/native/realm_core.dart:113
#3      _RealmLibraryEx.invokeGetBool
package:realm/…/native/realm_core.dart:2730
#4      _RealmCore.getListSize.<anonymous closure>
package:realm/…/native/realm_core.dart:1106
#5      using
package:ffi/src/arena.dart:124
#6      _RealmCore.getListSize
package:realm/…/native/realm_core.dart:1104
#7      ManagedRealmList.length
package:realm/src/list.dart:72
#8      new ListIterator (dart:_internal/iterable.dart:329:28)
#9      ListMixin.iterator (dart:collection/list.dart:76:31)
#10     StringBuffer.writeAll (dart:core-patch/string_buffer_patch.dart:95:33)
#11     IterableBase.iterableToFullString (dart:collection/iterable.dart:269:14)
#12     ListMixin.toString (dart:collection/list.dart:588:37)
#13     mapPropsToString.<anonymous closure>
package:equatable/src/equatable_utils.dart:72
#14     MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#15     ListIterable.join (dart:_internal/iterable.dart:156:22)
#16     mapPropsToString
package:equatable/src/equatable_utils.dart:72
#17     EquatableMixin.toString
package:equatable/src/equatable_mixin.dart:38
#18     _StringBase._interpolateSingle (dart:core-patch/string_patch.dart:829:17)
#19     StringBuffer.write (dart:core-patch/string_buffer_patch.dart:64:24)
#20     StringBuffer.writeAll (dart:core-patch/string_buffer_patch.dart:105:9)
#21     IterableBase.iterableToFullString (dart:collection/iterable.dart:269:14)
#22     ListBase.listToString (dart:collection/list.dart:43:20)
#23     List.toString (dart:core-patch/growable_array.dart:502:33)
#24     mapPropsToString.<anonymous closure>
package:equatable/src/equatable_utils.dart:72
#25     MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#26     ListIterable.join (dart:_internal/iterable.dart:149:25)
#27     mapPropsToString
package:equatable/src/equatable_utils.dart:72
#28     Equatable.toString
package:equatable/src/equatable.dart:64
#29     _StringBase._interpolate (dart:core-patch/string_patch.dart:851:19)
#30     Change.toString
package:bloc/src/change.dart:31
#31     _StringBase._interpolate (dart:core-patch/string_patch.dart:851:19)
#32     RDOBlocObserver.onChange
package:rdo/presentation/bootstrap.dart:13
#33     BlocBase.onChange
package:bloc/src/bloc_base.dart:133
#34     BlocBase.emit
package:bloc/src/bloc_base.dart:99
#35     Bloc.emit
package:bloc/src/bloc.dart:153
#36     Bloc.on.<anonymous closure>.onEmit
package:bloc/src/bloc.dart:208
#37     _Emitter.call
package:bloc/src/emitter.dart:133
#38     _Emitter.forEach.<anonymous closure>
package:bloc/src/emitter.dart:102
#39     _rootRunUnary (dart:async/zone.dart:1406:47)
#40     _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#41     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#42     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#43     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#44     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#45     _StreamController._add (dart:async/stream_controller.dart:648:7)
#46     _rootRunUnary (dart:async/zone.dart:1406:47)
#47     _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#48     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#49     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#50     _DelayedData.perform (dart:async/stream_impl.dart:515:14)
#51     _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
#52     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591:7)
#53     _rootRun (dart:async/zone.dart:1390:47)
#54     _CustomZone.run (dart:async/zone.dart:1300:19)
#55     _CustomZone.runGuarded (dart:async/zone.dart:1208:7)
#56     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1248:23)
#57     _rootRun (dart:async/zone.dart:1398:13)
#58     _CustomZone.run (dart:async/zone.dart:1300:19)
#59     _CustomZone.runGuarded (dart:async/zone.dart:1208:7)
#60     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1248:23)
#61     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#62     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
      )
[log] RealmException: Error code: 7 . Message: Access to invalidated Collection object

Relevant log output
[log] RealmException: Error code: 7 . Message: Access to invalidated Collection object

Your code is trying to get the length of a realm list on a realm object that is already dead, ie. deleted in the database.
If you need to access data on an object after it is deleted, consider freezing it before deleting it. That way you can still access the old state.
Otherwise, re-structure your code to avoid accessing deleted realm objects.

Good afternoon @nielsenko
Thank you very much for answering.
Sorry for my lack of intelligence, but when you say:
Your code is trying to get the length of a realm list on a realm object that is already dead, ie. deleted in the database.

If you need to access data on an object after it is deleted, consider freezing it before deleting it. That way you can still access the old state.

Otherwise, re-structure your code to avoid accessing deleted realm objects.

What would that be?
Do you have any examples to point out?
What left us confused is that, we do this same process in the other objects of the project and the problem is not generated, only in this resource that the error is sent to us.

import 'dart:isolate';
import 'dart:math';

import 'package:realm_dart/realm.dart';

part 'race.g.dart';

@RealmModel()
class _Stuff {
  late int id;
}

// lazy as all non-const globals in Dart
final realm = Realm(Configuration.local([Stuff.schema]));

void main(List<String> arguments) {
  final x = realm.write(() => realm.add(Stuff(1)));
  final y = x.freeze();
  realm.write(() => realm.delete(x));

  print(y.id); // <-- safe since y was frozen (ie. point to old version of x)
  print(x.id); // <-- throws since x is deleted from realm.

  Realm.shutdown();
}

outputs:
1
Unhandled exception:
RealmException: Error getting property Stuff.id Error: RealmException: Error code: 7 . Message: Accessing object of type Stuff which has been invalidated or deleted
#0      RealmCoreAccessor.get (package:realm_dart/src/realm_object.dart:213:7)
#1      RealmObjectBase.get (package:realm_dart/src/realm_object.dart:316:29)
...

In package:rdo/presentation/bootstrap.dart:13 you have hooked up some RDOBlocObserver.onChange that eventually ends up accessing the length of a realm list on a dead realm object while constructing an iterator.

BTW, in:
final activitiesModelList = activitiesChange.changes.map((event) => event
          .results
          .toList() // <-- this hydrates the full list
          .map((activity) => ActivitiesModel.fromRealm(activity)) // <-- this hydrates every object
          .toList());

you are loosing a lot of the benefits of realm in my opinion.
After that you have a stream of fully instantiated List<ActivitiesModel>s. Nothing is loaded lazy after here, if I guess the implementation of ActivitiesModel.fromRealm correctly.
If your lists are small (and since realm is fast) it will work, but consider constructing bloc/view model like objects lazily, and don't copy out properties from your realm objects, but access them on demand.

In the short term you could consider guarding against accessing dead realm objects by sprinkling strategic if (x.isValid) (where x is a realm object) throughout your code, but it becomes messy fast.
...
  print(y.id); // <-- safe since y was frozen (ie. point to old version of x)
  if (!x.isValid) print('x is dead'); // <-- safe to call isValid on dead objects
  print(x.id); // <-- throws since x is deleted from realm.
...

In package:rdo/presentation/bootstrap.dart:13 you have hooked up some RDOBlocObserver.onChange that eventually ends up accessing the length of a realm list on a dead realm object while constructing an iterator.
You didn't show me that code, but that is where the stack trace leaves your code, as far as I can tell.

Good Morning @nielsenko!
I'm sorry for the delay in responding.
So this resource is just a bloc observer that helps us map the flows.
We are currently enjoying the benefits of the stream that the realm lib gives us together with the features of flutter_bloc.
class RDOBlocObserver extends BlocObserver {
  @override
  void onChange(BlocBase bloc, Change change) {
    super.onChange(bloc, change);
    log('onChange(${bloc.runtimeType}, $change)'); // <- this is line 13 in the code
  }

  @override
  void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
    log('onError(${bloc.runtimeType}, $error, $stackTrace)');
    super.onError(bloc, error, stackTrace);
  }
}

BTW, in:
final activitiesModelList = activitiesChange.changes.map((event) => event
          .results
          .toList() // <-- this hydrates the full list
          .map((activity) => ActivitiesModel.fromRealm(activity)) // <-- this hydrates every object
          .toList());

you are loosing a lot of the benefits of realm in my opinion.
After that you have a stream of fully instantiated List<ActivitiesModel>s. Nothing is loaded lazy after here, if I guess the implementation of ActivitiesModel.fromRealm correctly.
If your lists are small (and since realm is fast) it will work, but consider constructing bloc/view model like objects lazily, and don't copy out properties from your realm objects, but access them on demand.

So in this case, would it be better to use the model classes that Realm provides us?
This class you showed is a mapper that transforms the Realm class into a class to be used in our domain.
I'll leave below the implementation of this class that you indicated:
class ActivitiesModel extends ActivitiesEntity with EquatableMixin {
  final String? idModel;
  final String rdoIdModel;
  final String? statusModel;
  final List<String>? placeModel;
  final String? descriptionModel;
  final AuditModel? createdAtModel;
  final AuditModel? updatedAtModel;

  ActivitiesModel({
    this.idModel,
    required this.rdoIdModel,
    this.statusModel,
    this.placeModel,
    this.descriptionModel,
    this.createdAtModel,
    this.updatedAtModel,
  }) : super(
          id: idModel,
          rdoId: rdoIdModel,
          status: statusModel,
          place: placeModel,
          description: descriptionModel,
          createdAt: createdAtModel,
          updatedAt: updatedAtModel,
        );

  // mapper that turns the Realm object into a managed class in the project
  factory ActivitiesModel.fromRealm(Activities activities) {
    return ActivitiesModel(
      idModel: activities.id.hexString,
      rdoIdModel: activities.rdoId.hexString,
      statusModel: activities.status,
      placeModel: activities.place,
      descriptionModel: activities.description,
      createdAtModel: activities.createdAt != null
          ? AuditModel.fromRealm(activities.createdAt!)
          : null,
      updatedAtModel: activities.updatedAt != null
          ? AuditModel.fromRealm(activities.updatedAt!)
          : null,
    );
  }

  // mapper that transforms the domain class to a Realm object
  // It is used for create/update/delete operations
  Activities toRealm() {
    return Activities(
      ObjectId.fromHexString(idModel ?? ObjectId().hexString),
      ObjectId.fromHexString(rdoIdModel),
      status: statusModel,
      place: placeModel ?? [],
      description: descriptionModel,
      createdAt: createdAtModel?.toRealm(),
      updatedAt: updatedAtModel?.toRealm(),
    );
  }

  factory ActivitiesModel.fromEntity(ActivitiesEntity activitiesEntity) {
    return ActivitiesModel(
      idModel: activitiesEntity.id,
      rdoIdModel: activitiesEntity.rdoId,
      statusModel: activitiesEntity.status,
      placeModel: activitiesEntity.place,
      descriptionModel: activitiesEntity.description,
      createdAtModel: activitiesEntity.createdAt == null
          ? null
          : AuditModel.fromEntity(activitiesEntity.createdAt!),
      updatedAtModel: activitiesEntity.updatedAt == null
          ? null
          : AuditModel.fromEntity(activitiesEntity.updatedAt!),
    );
  }

  ActivitiesModel copyWith({
    String? id,
    String? rdoId,
    String? period,
    String? weather,
    String? condition,
    String? description,
    List<String>? place,
    AuditModel? createdAt,
    AuditModel? updatedAt,
  }) {
    return ActivitiesModel(
      idModel: id ?? idModel,
      rdoIdModel: rdoId ?? rdoIdModel,
      statusModel: status ?? statusModel,
      placeModel: place ?? placeModel,
      descriptionModel: description ?? descriptionModel,
      createdAtModel: createdAt ?? createdAtModel,
      updatedAtModel: updatedAt ?? updatedAtModel,
    );
  }

  @override
  List<Object?> get props => [
        idModel,
        rdoIdModel,
        statusModel,
        placeModel,
        descriptionModel,
        createdAtModel,
        updatedAtModel,
      ];
}

Regarding the line 13 in RDOBlocObserver and looking at the stacktrace:
...
#30     Change.toString
package:bloc/src/change.dart:31
#31     _StringBase._interpolate (dart:core-patch/string_patch.dart:851:19)
#32     RDOBlocObserver.onChange
...

It is the $change that evokes a Change.toString() that tries to describe before and after. But here the realm list is already dead, so that fails.
Regarding ActivitiesModel.fromRealm it is as I suspected. Note how you are accessing every property of the realm object in the factory constructor, and copying the values out into a new ActivitiesModel object. This means you have defeated the lazy loading that happens when accessing the properties of a realm object.
It is not that it won't work, but it is working a bit against the grain of realm, I think.
I hope you got a few pointers to work on. Good luck with your project @ffelicioautodoc!

In this case, would it be better for our entire project to only use Realm classes (without using mappers/converters)?
Was that really what you meant?

Well, don't introduce mappers just because that is how you would normally do with a database. There are valid reasons to have wrappers, but use them sparsely and try to construct them lazily when you do, ie. when accessing index i of a list, instead of copying the entire list eagerly.
I don't know you project in detail, so it would be a bit presumptuous of me to say don't use mappers, but at least be careful when using them together with Realm.

I would like to continue this conversation with mappers, because I stumbled with same problem. I noticed especially when I have large list of data objects that are mapped, there application loses performance hard, reasons you stated above -> objects are not load lazily but every value is read and converter.
I have just no idea how to handle this problem correctly, can you show code example, what do you mean by "when accessing index i of a list, instead of copying the entire list eagerly.".
I need app objects from realm for several reasons:

I have access to Flutter objects like Color and so on (at least I couldn't find that realm support type converters)
it separates database layer from app layer to preserve Clean Architecture
I have relationship objects that are non-nullable, realm objects has to be nullable, for example `late $NonNullableLocal? nonNullable; (I do understand why it's there, because DB relationship object can be deleted at this point)

I wanted to find maybe there are ways how I can map all list to from realm objects to app objects lazily, so that I didn't lose lazy realm object benefits, but again I don't know if and how it's possible.
Also I couldn't understand in app model how to handle multiple relationship lazy loading, so I don't load large chunks of data, if I load and map all objects that have multiple relationships.
I would be really thankful if you could provide solution of realm best practice to handle this problem.

I have just noticed .toList() is hydrating the full list but Iterable seems like not.

@ebelevics Yes, when calling toList on any implementor of List (including RealmList) you are copying all elements and creating a new dart List.
It is a bit unclear what you are trying to say explain here:

I have also noticed if realm object has relationship to multiple objects  late List<_Person> drivers;, for some reason local.drivers.map((driver) => toPersonApp(driver)).toList(), doesn't lose any performance here, only lose performance if mapping RealmResults to List.

In particular since I can only guess about toPersonApp. But perhaps you are asking why there is no difference in performance between:
for (final x in local.drivers.map((driver) => toPersonApp(driver)).toList()) {
  // do something ..
}

and
for (final d in local.drivers) {
  final x = toPersonApp(d);
  // do something ..
}

If so, then yes, there is no difference - the work is the same. You are iterating over the full list hydrating and mapping every thing in both cases.
But there is a (potentially big - depending on size of the list) difference between doing:
toPersonApp(local.drivers[424242]); // fetch handle to a single Person, then hydrates and maps it.

and
local.drivers.map((driver) => toPersonApp(driver)).toList()[424242]; // hydrates and maps every Person, then select a single.

First is O(1) second is O(n) where n is the size of local.drivers. It obviously depends on the size of lists if this is actually something your users will feel.
Now to your original question..
Regarding non-realm types such as Color you need to do the mapping, fx:
@RealmModel()
class _Pen {
  @MapTo('color')
  late int colorAsInt;

  Color get color => Color(colorAsInt);
  set color(Color c) => colorAsInt = c.value;
}

I hope we can make this more convenient later.
The non-nullable relations is impossible for us in general, since we cannot prevent some part of your system from deleting the objects pointed to. But if you can guarantee that won't happen, you can do something similar as with Color above, and stripping the nullability:
@RealmModel()
class _Line {
  @MapTo('pen')
  late _Pen? penBacking;

  _Pen get pen => penBacking!;
  set pen(_Pen p) => penBacking = p;
}

If it is worth the anxiety it to prevent !. anxiety .. maybe, maybe not.
Regarding, separation of database layer, and clean architecture.. Introducing abstractions to easily replace core components in your app is a bit overused in my opinion. You wouldn't abstract away the fact that your are using flutter, just in case a different UI framework come along for Dart at one point. More to the point, the common abstraction layer we all learned to hide the database behind does not play well with realm, as you are starting to realise. In general I suggest you model your entities directly as realm objects, and don't don't treat realm objects as just something to traffic data in and out of the database. This jives better with Realm.
I hope this helps a bit..
Anyway.. if you still prefer to map entities and results, and cannot live with the performance of all the copying you have introduced, then you need to start looking a writing lazy list wrappers. Here is a simple one:
class LazyMappedList<From, To> with ListMixin<To> {
  final List<From> _source;
  final To Function(From) _mapper;
  final From Function(To)? _reverseMapper;

  LazyMappedList(this._source, this._mapper, [this._reverseMapper]);

  @override
  int get length => _source.length;

  @override
  set length(int newLength) => _source.length = newLength; // this is likely to cause trouble..

  @override
  To operator [](int index) {
    return _mapper(_source[index]);
  }

  @override
  void operator []=(int index, To value) {
    if (_reverseMapper == null) {
      throw UnsupportedError('Cannot set value of a lazy mapped list');
    }
    _source[index] = _reverseMapper!(value);
  }
}

This is of the top of my head, haven't tested it at all..
BTW, it is better (for me/us at least) to open a new issue, instead of piggy-backing on an old one. Even if the question is closely related. You can always refer to the previous issue from the new one.


feat(testing): accept type-hinted requests as assertSent parameters

Closes https://github.com/saloonphp/saloon/issues/417
This pull request adds support for type-hinting a request class as the first parameter of the closure passed to MockClient#assertSent. This allows running this kind of test:
MockClient::getGlobal()->assertSent(function (CreateDealRequest $request) {
    expect($request->body()->all())->toMatchArray([
        'status' => DealStatus::OPEN,
    ]);
});

Before this pull request, the test above could only be written using a condition:
MockClient::getGlobal()->assertSent(function (Request $request) {
    if ($request instanceof CreateDealRequest) {
        expect($request->body()->all())->toMatchArray([
            'status' => DealStatus::OPEN,
        ]);

        return true;
    }
});

I ignored the phpstan errors as they seem to be false-positives.

For some reason, I can't get GitHub to let me comment on the changes on my tablet, so I'll make a regular comment for now.
The PHPStan errors around the Reflection APIs might need an extra look.
F.ex., the ReflectionFunction only accepts a Closure, but we're passing a callable.
I'm not sure how common it is to pass an invokable object, though.
That should be relatively easy to fix.
new ReflectionFunction($callable(...));

I'm not 100 % sure on the ReflectionType for the parameters.
ReflectionType itself doesn't have a getName(), nor does it's children except for the ReflectionNamedType.
This may or may not be an issue.
If only one type is defined, it'll work.
If no parameters are defined, then index 0 will also give an error.
But realistically, I feel like these are edge cases.


Enable build cache by default

This PR enables build cache by default.

@bot-gradle test this

OK, I've already triggered ReadyForMerge build for you.

@blindpirate This PR enables the local build cache by default, not the remote build cache. I think the idea is to let everyone use the remote build cache by default.

@bot-gradle test QF

OK, I've already cancelled the old build and triggered a new QuickFeedback build for you.

@bot-gradle test QF

OK, I've already triggered QuickFeedback build for you.


The Example Easy Connect Do Not Work

Describe the Bug
I found that problem in the Doc's example. Here is the link: https://reactflow.dev/docs/examples/nodes/easy-connect/. When I start Drag To Connect, put the connect line on the Drop Here node, but it didn't work as expected. I guess this problem maybe related to the new prop connectionRadius. I also found this problem in my project.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue

open the link https://reactflow.dev/docs/examples/nodes/easy-connect/
just test the example Easy Connect

Expected behavior
Expected I can connect two node when I drop the line manually
Screenshots or Videos
https://user-images.githubusercontent.com/107463221/215312740-2501931e-e8c3-439e-95bb-3f1fd37565e5.mp4
Platform

OS: [e.g. macOS, Windows, Linux]
Browser: [e.g. Chrome, Safari, Firefox]
Version: [e.g. 91.1]

Additional context
No response

@moklick Hope you can reply this as soon as possible. Thanks

@moklick Hi, the example itself still has this bug.
https://codesandbox.io/s/hktrj8?file=%2FApp.js&utm_medium=sandpack


rendering in firefox 34.0

latest version of firefox (34.0) seems to have broken the rendering a bit... if you drag the scroll bar and a node on the edge of the canvas moves left, it stretches (see pic).
After 3 seconds, of inactivity, it redraws and corrects itself!

I'm going to close this; scrolling the pane doesn't invoke any node-red code - it's all the browser's doing.


Dead pixel handling

In astrophotography, there are calibration frames of various types, in particular darks, where you cover the lens and takes some shots. The resulting image(s) will show only dead/hot pixels. From those images, you create a master dark by simple averaging.
In the actual stacking step, you then subtract the master dark from the images so you can prevent artifacts like the ones below.
Another way to handle this is to check if the image has pixels which are "unnaturally" different to the previous aligned images, but that's probably easier than in astro, where you have mostly the same image, unlike with focus-stacking.
Can we have an option to add a dark image to subtract or should we use something like imagemagik instead?

Sounds like a reasonable feature but I have no plans to implement it myself.


Add Bootstrap and modal form to CTA

I wish to add Bootstrap and add a modal form to CTA for now.
Let me know if I can work on this.
Thanks!

I had just now made a PR for this and waiting for merge


Reorganized files for use with Unity Package Manager

This reorganizes the file structure so that the repo can be used from the Unity Package Manager. Note that this might make it incompatible for users who are accustomed to copy-pasting the files into Asset directory (I didn't test this), however they should still be able to copy-paste it into Packages.
Samples have been reworked to be compatible with UPM and they can be imported right from the UPM interface:

Looking good, what about changing the readme to make it clear it's best to import through the Package Manager?

Added note to README.


Lazy loading hotfix

Failures were detected when using multiple GPUs and using lazy loading. The source of these errors were narrowed down to a race condition that occurs when accessing/modifying codeObjectFilename in the Solution object when multiple threads are accessing the same solution. I've introduced a new class to wrap that variable and protect all instances where it is being assigned to or read from. The failure hasn't been observed with these changes, so I'm confident it fixes the issue.
It was also found that m_codeObjectDirectory could result in a race condition, I've moved the assignment and reading of that variable into a mutex protected area.

@benjaminulmer I originally tried adding a mutex to ContractionSolution, but we are copying it in several places so I saw several options:

Write a copy and assignment operator for the ContractionSolution class
See if I can reorganize the code to eliminate the copies (might require a move constructor)
Make a wrapper for the problem variable

It might be a little heavy handed, but since this is the only thing in that class being accessed in parallel, it has the smallest impact on the code itself, and makes it more certain that it can't cause issues even if you refer to it elsewhere in the future. That's my reasoning at least

If the semantics of std::unique_ptr<std::atomic<std::string>> are sufficient, that might be worth considering as an alternative to ThreadSafeValue<std::string>. It's not copyable, but it is movable.

@TorreZuk The crashes were messy so we weren't able to examine the stack unfortunately. We did work out a couple different ways that it could occur though, one situation involved a race condition within placeholderLibrary when assigning to codeObjectFilename, the other was between placeholderLibrary and the generateXCall function. The second happening less frequently. The ideal solution in my mind would be to have codeObjectFilename set during the deserealization process of TensileLibrary.dat, but that is more of an involved process and requires more consideration. It's a change I plan on trying to make on the develop branch, but my primary goal for this PR was to have a fix that deals with the issues and has as small of a chance of introducing new problems as possible.

If the semantics of std::unique_ptr<std::atomic<std::string>> are sufficient, that might be worth considering as an alternative to ThreadSafeValue<std::string>. It's not copyable, but it is movable.

@cgmb Unfortunately that still gets a template error as far as I can tell. It looks like there's a specialization for shared_ptr in c++20 that can allow std::atomic<std::shared_ptr>, but I'm not sure whether or not T still needs to be a trivially copyable value

Full rocBLAS build and test passed using cf8a6d0. Jeremy did some sanity checks on the latest commit; I don't think the changes warrant another full build and test.
I agree with Torre that this is a bit of a bandaid and we should revisit in the future. However, I do believe this properly addresses the issue, at least with regards to the library structures we actually generate and how we interface with them in rocBLAS. All these issues will disappear if we can figure out how to set this properly at deserialization time, so that should be where we focus our efforts in my opinion.
If/when precheckin passes and Cory (and others) approve the changes we can go ahead with the merge and follow the rest of the Tensile/rocBLAS hotfix process (ping me if you have questions).

If the semantics of std::unique_ptr<std::atomic<std::string>> are sufficient, that might be worth considering as an alternative to ThreadSafeValue<std::string>. It's not copyable, but it is movable.

@cgmb Unfortunately that still gets a template error as far as I can tell.

Ah. Too bad. I'd thought the mutex-based fallbacks for std::atomic could handle arbitrary types, but it seems I was mistaken.
The underlying concern was basically that the semantics of a type like ThreadSafeValue<std::string> are very complex. It is extraordinarily difficult to do this sort of fine-grained parallelism correctly, and doubly so when you're defining your own custom abstractions. It would be nice over the long term to find a pathway towards a simpler solution.


align all balances with decimal

Align all balance displays along decimal.
I want to be able to tell at a glance which is larger, even in a long list of transactions:
100
or
0.25106631
In a long list, it's kinda messy.
One way to achieve this would be to display 8 decimal places for each transaction. It's not elegant, but would work.

Sounds nasty to me actually but I think we'll need other feedback on this to see if it's what others want.

Displaying 8 decimal places is the easiest way to fix this.
Alternatively we could calculate the amount of white space needed on the end of a balance; and then display that amount of white space at the end to alight it.

This is not my comment either way but Paycoin is actually 6 decimal places.

I always forget @mitchellcash. You are correct.

@mitchellcash is it bad that I realized that but chose not to comment?

@IngCr3at1on tsk tsk ;)

So when cryptsy shows 8 decimals that's just following BTC convention on their internal ledger?
Whoever designed this coin surely lacked ambition about its future value.

@mdpfeiffer the original coin spec called from it going out to 8 decimal places and the original devs never changed the source (which was peercoin) from 6 to 8. Leaving us sort of stuck with 6.

I always wondered if we could push it back to 8 but it seemed like it would mess a lot of shit up

@mitchellcash I had a theory/idea on how to do that at one point but I've never attempted it. That's a discussion for somewhere else lol


suggestion: Retry http_fetch_errors

About once a day, the Builder throws an error due to one of the API calls timing out. One possible solution I'm suggesting is retrying the fetch whenever HTTPoison.get returns an error.

I'll "yes, and" this with a suggestion that if we're doing this for all API requests, we might consider adding a backoff, to avoid the retries themselves making the problem (whatever it is) worse. Screens already does this using the Retry package.

Yeah good idea. I kept constant_backoff but we can also use exponential or linear if those are preferred.

@digitalcora Unfortunately this did not seem to work in dev-green overnight. Sentry error here. It is a new error but that's from me trusting dialyzer and messing up the pattern of the error (It can't figure out what will be returned). Even this looks like a new error, it only occurs for the same reason as before. Do you think this change would still be nice to have or should we explore other solutions first?

Given this runs on a timer, we should be able to figure out how many of the rebuilds we'd expect to see in a given day are failing, both with this solution and without. Do the retries make an appreciable dent? If before it was failing 50% of the time and now it's 10%, that would sound like a great start, even if we could improve it later. If before it was 50% and now it's 40%, maybe we should investigate further. If before it was 10% and now it's 5%, maybe we can live with the failures for now since it's not a major issue.

That doesn't sound bad at all — considering also the apparent complexity of addressing this and the fact that it's an out-of-band task, I'm fine with ignoring the crashes as long as they don't escalate. I went ahead and did an "Archive => Until escalating" on these, which should notify us again only if the error rate exceeds the historical weekly rate.

Sounds good. I can close this then. Was kind of a knee-jerk reaction to being annoyed by the error 😅.


please allow full editing of QEMU config.

I appreciate the newer versions ( 4.3.5 ) having a "new" button to add a new configure line, but it is extremely inconvenient to not be able to modify the existing configuration lines.  I understand leaving it alone by default, but there should be an "advanced mode" where it unlocks the entire config for editing, and has a "revert to default"  option.
Thank you for considering this!

It is not possible to support something like this because 1) we use a custom build of QEMU and 2) the GUI depends on certain arguments. This is an XY problem though. You're asking to modify the QEMU config but actually there is probably something you want to do that isn't working on UTM right? Please make an issue with precisely what you want to do and the QEMU command that enables it.

I understand what you're saying. But I'd at lest like to be able to have it for testing or something... maybe make it hidden unless you hold down Option when selection the page or something like Apple does with the Libraries folder.
My needs do come from wanting to fix something that's not working in UTM, yes...
For instance, I want to be able to use custom OVMF files. As far as I know, I can't do this in UTM. ( nor could I ever get any disk to boot with it... for example Mojave with OpenCore can run completely fine direct from stock QEMU, but I could never get it working with UTM.
And I want to use virtio with x86 Mac, At minimum virtue-blk-pci,  in this case the same Mojave system which does support it on the guest side. I think that the value of your work on xxl probably outperforms virtio-vga, but that support is in Monterey too.  and works fine in QEMU 8.x.
I realize there are current existing issues with going to 8.x but I just want to point that out and was hoping I could try to find work arounds, but without the ability to fully edit the config to experiment, my ability to contribute is weak.

For instance, I want to be able to use custom OVMF files. As far as I know, I can't do this in UTM.

You can by creating a new "drive" and setting the image type to BIOS

And I want to use virtio with x86 Mac, At minimum virtue-blk-pci

You can do this by setting the interface to VirtIO

and works fine in QEMU 8.x.

No arguments you change can make it 8.x

Like I said, it's not that I don't want to do this. It physically cannot be done. UTM dynamically generates settings based on options. I have some vague plans in the future to make a UTM Lite which just acts as a SPICE client but that's not anytime soon.


Add in restrictions on Lum auras

Players couldn't have just every single Aura. Probably just show this as an error rather than some other way.

This is implemented.


clone_wp_site.py: Database config not updated properly

clone_wp_site.py does not update the cloned wp-config to point to the dst database. And so the dst app unintentionally reads and writes to the src database.
This means that when the script updates the siteurl and home options through the wp-cli tool, it modifies the src database, even though it's intended for the dst app.
https://github.com/opalstack/opalstack-python/blob/13642f1e74de74daa38e8c5ed97cfe432494eeee/examples/clone_wp_site.py#L159-L161
So you end up with the src app redirecting to the dst domain, which is serving the dst app, but is still using the src database.

This was quite a serious bug. Sincere apologies for oversight and trouble it caused.
I've tested and applied your fix. Will soon release a 1.0.1 version which includes this fix.


Typing

functions don't test for typing errors yet.
use pydantic to fix

Added pydantic feature to test input typing errors!

Added pydantic feature to test input typing errors!

Added pydantic feature to test input typing errors!


Output form media on add/edit/chooser document forms with custom models

Similar to eaad01308142337739d7edd9f08bd8e714be23f0, but for Document

Thanks @sir-sigurd!


Fix name of GitLab CI file

Slight oversight: GitLab only picks up '.gitlab-ci.yml' (leading dot)

Checklist

[x] Keep pull requests small so they can be easily reviewed.
[x] Categorize the PR by setting a good title and adding one of the labels:
bug, enhancement, documentation, change, breaking, dependency
as they show up in the changelog

As discussed internally, it's intentional that GitLab doesn't pick up the file.

Firstly, the output file is somewhere in manifest/ path, GitLab won't pick it up anyway. However, users can manually specify in GitLab where GitLab should look for this file.
Secondly, manual setup of secrets is required anyway in order to make the pipeline pass.


XLSX property tests often fail

Maybe because of strange characters in arbitrary string data? \NUL?

Important steps:

Arbitrary Text could be restricted with QuickCheck's PrintableString.
Our data classes need Ord instances to have them deeply sorted for data comparisons
Some testing magic is neccessary to have unique Persons, unique Tasks and valid assignees in test data, otherwise the Ord instances might not do the right thing™.


Add support for API Key management

Implements the ability to manage/create API keys via Terraform, based on some of the initial work done here.
Closes #70.

Thanks @webfella !


Unable to use map after follow the step

After Following the step I got the error when setup the init in main.ts and I don't know why it happen, I don't understand this error.
Describe the bug
A clear and concise description of what the bug is.

Expected behavior
Should be normal not do anything when I was not use GMap or after using Gmap Components that will normal show the map.
Screenshots

Desktop (please complete the following information):

Browser: Brave

my GitHub project: https://github.com/whitersun/trashTime

The issue is caused by fast-deep-equal. You may want to check https://github.com/fawmi/vue-google-maps/issues/164#issuecomment-1324013605 and https://github.com/fawmi/vue-google-maps/issues/188.
Just include the following in your vite.config.js file:
optimizeDeps: {
    include: [
        "@fawmi/vue-google-maps",
        "fast-deep-equal"
    ]
}

works for me


GCS upload provider

Add an upload provider that uses Google Cloud Storage to host uploaded files.

Resolved with https://github.com/redpwn/rCTF/pull/296


Serde for Revault transactions

(Moved from https://github.com/re-vault/revault/pull/20)
If you naively put features = ["use-serde"] in the cargo.toml for bitcoin, will serde's #[derive(Serialize, Deserialize)] work for the ravault tx types?
@darosior : No, it's a newtype: i need to make it a trivial implem (not using #derive).

But #derive does handle newtypes afaik

Yes. You are right it does. However is The PSBT struct is not serde-derived upstream (was actually going to submit a patch!), so we need to implement the trait ourselves.

Is it not implemented here: https://github.com/rust-bitcoin/rust-bitcoin/blob/master/src/util/psbt/serialize.rs ?

Well it does not seem to be.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le vendredi, octobre 2, 2020 12:57 PM, JSwambo<EMAIL_ADDRESS>a écrit :

Is it not implemented here: https://github.com/rust-bitcoin/rust-bitcoin/blob/master/src/util/psbt/serialize.rs ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Ah I just realized its not 'serde' but consenses::encode

Yep, but that means our implem will be straightforward: just call consensus::encode() :-)
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le vendredi, octobre 2, 2020 12:58 PM, JSwambo<EMAIL_ADDRESS>a écrit :

Ah I just realized its not 'serde' but consenses::encode
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Closing this, as we now have serde support! :tada:


Add error.path

Follow up from https://community.apollographql.com/t/path-in-error-type/931
Add path to GraphQL errors

Closed because path is already in customAttributes and exposing directly in error would be a breaking change. I'll open a follow up PR in dev-3.x


EXIF-rotated images are cut-off in messages

Summary
Image attachments (post.metadata.images) do not take EXIF rotation into account and are heavily - and wrongly - cropped.
I did not find a matching open bug report.
Environment Information

Device Name: FP5
OS Version: Android 13
Mattermost App Version: c5171418b634ad8111c170bb02a5d62be10952b9
Mattermost Server Version: 9.5.9

Steps to reproduce

Upload a message with an exif-rotated image (or post a link to one, e.g. https://github.com/recurser/exif-orientation-examples/blob/master/Portrait_5.jpg?raw=true).
Observe the result in the webapp
Observe the result on mobile
Observe the result on mobile after clicking on it (image gallery)

Expected behavior
The image is displayed completely
Observed behavior (that appears unintentional)
The image is resized to fit the raw image bytes aspect ratio, cutting of basically the whole image.
Possible fixes
Somewhere, these two should be converted/swapped:
https://github.com/mattermost/mattermost-mobile/blob/2a02a61b6bf25fffa8f385da0b7cdeabd6e2d26a/types/api/posts.d.ts#L42-L43
Probably not in the API request, but on their way to the image viewer components. Maybe the server should do this, it is currently kind of lying :P

Opened https://mattermost.atlassian.net/browse/MM-61477.


Teams app does not send composeExtension/anonymousQueryLink  invoke request

I am running the sample "msgext-link-unfurling" for C# and trying to call anonymousQueryLink method.
I followed the instruction from Microsoft Docs https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/link-unfurling?tabs=desktop%2Cdotnet%2Cadvantages#enable-zero-install-link-unfurling
and changed in my manifest the value supportsAnonymizedPayloads , and added an implementation of the
 OnTeamsAnonymousAppBasedLinkQueryAsync(ITurnContext<IInvokeActivity> turnContext, AppBasedLinkQuery query, CancellationToken cancellationToken) method in my LinkUnfurlingBot class.
However, this new method is never called, because I can see in the profiler that the Teams app still sends requests with the type "composeExtension/queryLink" . It seems like supportsAnonymizedPayloads setting in manifest did not change the type of invoke to "composeExtension/anonymousQueryLink" (that's what I expect according to the Docs page).
What is the correct way to configure manifest or Teams app to send composeExtension/anonymousQueryLink ?
here's my manifest:
      "messageHandlers": [
        {
          "type": "link",
          "value": {
            "domains": [
              "*.botframework.com",
            ],
            "supportsAnonymizedPayloads": true,
            "suggestedActions": {
              "actions": [
                {
                  "type": "setCachePolicy",
                  "value": "{\"type\":\"no-cache\"}"
                }
              ]
            }
          }
        }
      ]

@kostinams -Thanks for reporting your issue.
We will check this at our end and will get back to you.

@kostinams -Could you please check the below sample-
https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/af593fbf2a87b81cff39e5c054b98017908ca448/samples/msgext-search-sso-config/nodejs/bots/teamsMessagingExtensionsSearchAuthConfigBot.js#L360
 if(context.activity.name === "composeExtension/anonymousQueryLink") {             const card = CardFactory.adaptiveCard({                 "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",                 "type": "AdaptiveCard",                 "version": "1.5",                 "body": [                     {                     "type": "TextBlock",                     "text": "Zero Link unfurling card",                     "weight": "bolder",                     "size": "extraLarge"                     },                     {                     "type": "TextBlock",                     "text": "Install the app to view full content of the card.",                     "size": "large"                     }                 ]             })

@kostinams - Thank you for sharing the findings. We will review them on our end and keep you updated.

@kostinams -If you install the app and then add the unfurl link, it is displaying the composeExtension/queryLink.
Additionally, zero-install link unfurling assists in previewing your shared links before users discover or install your app in Teams. You can anonymously unfurl cards using a new invoke request or create pre-authenticated Adaptive Card previews for users prior to them installing or authenticating your app.
also check the payload of the activity you're receiving. Verify that the 'anonymousQueryLink' information is being sent correctly in the activity's payload.
Reference document-https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/link-unfurling?tabs=desktop%2Cjson%2Climitations#enable-zero-install-link-unfurling

@kostinams -Yes, you can just upload the app; there's no need to install it.

@kostinams - First, you should add the app to the app store. Do not install the app. Then, you can try link unfurling and add the debugger to that method, as you mentioned above, and check the activity name."

@sayali-MSFT ,
I've just tried the Node.js sample you suggested - I am still receiving activity as 'queryLink' and not 'anonymousQueryLink' , attached a screenshot from debugger , you can see what's recieved from Teams app:

@kostinams Hey, did you ever end up figuring this out? Running into the same issue.


Stable version required

Brief feature description
Stable version for upstream applications and QNX support.
Detailed information
Hi, thanks for your kindly open-sourced solution, this seems promising. I notice that this project is under heavy code review and improvement recently, so when shall I consider this as one stable component for my projects, and will 1.x be around the corner?
And one more thing, I tried to build on QNX platform, and it succeeds at the compiling phase but failed to execute, the output looks strange.
/iox-roudi
1970-01-20 02:24:51.494 [ Info  ]: No config file provided and also not found at '/etc/iceoryx/roudi_config.toml'. Falling back to built-in config.
Log level set to: [Warning]
xxx/iceoryx/iceoryx_utils/source/posix_wrapper/message_queue.cpp:129 { static iox::cxx::expected<bool, iox::posix::IpcChannelError> iox::posix::MessageQueue::unlinkIfExists(const string&) }  :::  [ 89 ]  Function not implemented

@MiaoDX regarding the QNX issue, the posix message queue is not available by default so you have to start mqueue manually
I think @budrus can tell you more about the 1.x release. At least a stable API is around the corner, probably in October. If we do not encounter severe issues with that API after the initial release, we will keep it stable, regardless if it's a 1.x release or not

Thanks for the question @MiaoDX. Indeed, 1.0.0 is around the corner.
We will break the API in the next weeks, 0.17.0 is the last version with the old API. We already heavily work on the new API and new features like a C API, a waitset and history QoS. I guess we first introduce the new API on probation and start using it. When it feels stable and good we will do the 1.0.0 release with long-term support.
Check our  gitter channel  for updates

Yeah, looking forward to that ~
Currently, we are using hand-crafted cpp11+atomic ptr+move operation for single producer and single consumer scenario, the singleprocess demo does seem promising, and once QNX+Linux is all-well tested, I'd like to try out.


Improve MC UI branch field

It's unclear what the "branch" field is really for.  Make the UI understandable, and perhaps think about a default of main?  Again, not exactly sure how this value is used in the backend.

Turns out, "branch" isn't even hooked up to anything. It's a form item that is never passed on. What, if anything, do we actually want this to be?


Host networks probably shouldn't include <IP_ADDRESS>

It seems a bit obvious, and means different things on each host.

@paulbellamy what is this about? "Host networks" where?

It shows up below, and is used when calculating which ips are "local" vs "part of the internet".

means different things on each host.

Which is the issue we were tripping over in #1733, though there the impact was more severe.


Adds new Partner Highlight blog on semantic search.

Description
Adds new Partner Highlight blog on semantic search with several resources including code repos and videos.
Issues Resolved
N/A
Check List

[X] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

Pinging @pajuric and @natebower for review.

@pajuric Fixed the namign

@krisfreedain, @pajuric, @nateynateynate, any updates on this?

@dtaivpp - I plan to launch this tomorrow. Please update the date to 6/5/24.

@nateynateynate @krisfreedain - This blog is cleared to launch. Please publish.


AI Image Generator

Describe the project
Creating an AI image generator using Reactjs, nodejs and openai API
Issue Type:

[ ] Bug Report
[ ] Feature Request
[ ] Documentation
[x] New Project

Additional context
Add any other context or screenshots about the project here.
Screenshots

If applicable, add screenshots to help explain your problem.

@tapan31 I have already worked on this project and I know how to create this website.
Can you please assign me this issue?
<EMAIL_ADDRESS>github link: https://github.com/Manoj-2702

React project is not allow.


Contribute detailed nginx cache config back to gardenlinux-repo

What this PR does / why we need it:
Includes the latest changes to the live nginx cache config, namely:

'OK' and 'moved permanently' responses (200 and 301) are valid for 30d
'moved temporarily' responses (302) are valid only for one hour
any other response expires after ten minutes

@gehoern : apparently, w/o this cfg change, the proxy does not prevent repeated http-requests returning http-404, which recently happened (pbly due to a cfg change during build run, or some inconsistent repository state), which effectively again lead to our public IP address(es) being blocked for some time


[Bug] env var DBT_TARGET violates the rule of specificity

Is this a new bug in dbt-core?

[X] I believe this is a new bug in dbt-core
[X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior
dbt improperly ignores the --target CLI flag when environment variable DBT_TARGET is set.
$ export DBT_TARGET=nonvalid_target
$ dbt build --project-dir /dbt --target dev
12:31:08  Running with dbt=1.8.3
12:31:08  Encountered an error:
Runtime Error
  The profile 'xxx' does not have a target named 'nonvalid_target'. The valid target names for this profile are:
   - dev
   - prod

Expected Behavior
According to the documentation regarding flags (link):

The most specific setting "wins." If you set the same flag in all three places, the CLI option will take precedence, followed by the environment variable, and finally, the value in dbt_project.yml.

So I would expect the --target CLI option to be used even though the env var is set.
Steps To Reproduce

Set environment variable DBT_TARGET
Invoke dbt, passing the --target option for a target different than the contents of DBT_TARGET
Weep when dbt ignores --target and uses instead the contents of DBT_TARGET

Relevant log output
No response
Environment
- OS: Debian 11 (official python docker image `python:3.11-slim-bullseye`)
- Python: 3.11.9
- dbt: 1.8.3
- dbt-snowflake: 1.8.3

Which database adapter are you using with dbt?
snowflake
Additional Context
No response

Thank you for raising this issue @owenprough-sift -- agreed that dbt should use the value of --target instead of DBT_TARGET 🎯
This looks like the issue reported in https://github.com/dbt-labs/dbt-core/issues/10304.
What happens when you move --target to be before the build subcommand?

dbt --target dev build ... works as expected. But I'd still like #10304 to be fixed. 😉

But I'd still like #10304 to be fixed. 😉

💯 ! We've got a fix in flight: https://github.com/dbt-labs/dbt-core/pull/10423
In the meantime, I'm going to close this one as a special case of https://github.com/dbt-labs/dbt-core/issues/10304
Thank you as always for your insights on what is/isn't working as it should 🙏

@owenprough-sift we just merged https://github.com/dbt-labs/dbt-core/pull/10423. Once https://github.com/dbt-labs/dbt-core/pull/10427 is also merged, then it will go in the next patch release for dbt 1.8.x.


Debugging hangs Ipython

What steps will reproduce the problem?

fresh install of anaconda3 on up to date windows 10
create a file with the following code:
print("hello world")

press the debug button.
observe console hanging.
pressing stop debug button produces:
--KeyboardInterrupt--
For copying text while debugging, use Ctrl+Shift+C

only way to stop is to close the console and force reopen another one.
also pressing continue, step or anything does nothing.
Running the file works fine, but debugging is completely broken with no functionality at all.

Looks like this was already fixed: https://github.com/spyder-ide/spyder/issues/18552

Hey @AllenKll, thanks for reporting. This error should be fixed in our latest version (5.3.1).
Since it's still not available in Anaconda, you have two options:

Use our Windows or Mac installers, which you can find here.

Create a new environment with conda-forge packages. For that, please close Spyder, open the Anaconda Prompt and run the following commands there:
 conda create -n spyder-cf -c conda-forge spyder
 conda activate spyder-cf
 spyder

Please do that and let us know if it works for you.

Number 2 worked.
It created a link to spyder in a different directory than the default anaconda install ('Anaconda3' instead of 'Anaconda3 (64-bit)')   but it did work none the less.

Great! Thanks for letting us know about it.


E2E: go schedule main SLSA3 config-noldflags

Repo: https://github.com/slsa-framework/example-package/tree/main
Run: https://github.com/slsa-framework/example-package/actions/runs/2361678908
Workflow name: go schedule main SLSA3 config-noldflags
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.schedule.main.config-noldflags.slsa3.yml
Trigger: schedule
Branch: main
Date: Sat May 21 02:51:27 UTC 2022

Repo: https://github.com/slsa-framework/example-package/tree/main
Run: https://github.com/slsa-framework/example-package/actions/runs/2365083809
Workflow name: go schedule main SLSA3 config-noldflags
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.schedule.main.config-noldflags.slsa3.yml
Trigger: schedule
Branch: main
Date: Sun May 22 03:09:17 UTC 2022

Repo: https://github.com/slsa-framework/example-package/tree/main
Run: https://github.com/slsa-framework/example-package/actions/runs/2368742741
Workflow name: go schedule main SLSA3 config-noldflags
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.schedule.main.config-noldflags.slsa3.yml
Trigger: schedule
Branch: main
Date: Mon May 23 03:20:19 UTC 2022

Repo: https://github.com/slsa-framework/example-package/tree/main
Run: https://github.com/slsa-framework/example-package/actions/runs/2375241155
Workflow name: go schedule main SLSA3 config-noldflags
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.schedule.main.config-noldflags.slsa3.yml
Trigger: schedule
Branch: main
Date: Tue May 24 03:23:16 UTC 2022
Tests are passing now. Closing this issue.


feat: adding the shadow factory config

Fixes #75

Codecov Report

Merging #78 (767ba1d) into main (b1b87f3) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main      #78      +/-   ##
============================================
+ Coverage     90.83%   90.87%   +0.04%
  Complexity      596      596
============================================
  Files            87       87
  Lines          2445     2456      +11
  Branches        101      101
============================================
+ Hits           2221     2232      +11
  Misses          189      189
  Partials         35       35

Impacted Files
Coverage Δ

...lcali/device/pool/iot/ConnectionFactoryShadow.java
87.09% <100.00%> (+7.09%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1b87f3...767ba1d. Read the comment docs.


Semantic versioning

Just a few comments on semantic versioning:
v1.3.0 switched its dependencies to the ASP.NET Core non-LTS channel. This is a major change, which I think should have been versioned as v2.0.0.
Let me explain. Suppose you now find a bug. If you want to support both LTS and non-LTS channels, then you must fix v1.2.0 and v1.3.0 and release versions v1.2.1 and 1.3.1 respectively.
At that point, suppose you add functionality. You can create v1.4.0 after 1.3.1 but you cannot create 1.3.0 after v1.2.1 because that's already in use, and v1.2.2 would not reflect that extra features have been added. Don't you agree?
Let me be very annoying right now and also suggest a library rename to something that makes it more obvious this is not a Microsoft official library, for example:
AspNet.Mvc.TypedRouting => Ivaylokenov.AspNetCore.Mvc.TypedRouting
Should you decide to do this you can kill two birds with one stone because such a change will allow you to reset to v1.0.0.
What are your takes on this? Thanks for a GREAT library, it has saved me a lot of hard work.

Hi, I am not quite sure how to solve the versioning issue with the features but will do it when there is a new feature to add. As for the rename - I already intend to rename it - https://github.com/ivaylokenov/AspNet.Mvc.TypedRouting/issues/20 but without adding my name in front of it (it will be narcissistic). I believe the fact that there is no Microsoft in the name is enough to clarify the library does not come from them. Thank you for the suggestion and the nice words!


Make touch capacitance configurable from Micropython

Different people have different body capacitance, so various sensitivity might help compensating different contexts.
I.e. "gloves mode".

Good point. We really need a lot of testing for this. There are only 2-3 parameters the user needs control over in the AZ chip to do this tuning. They will require the AZ registers also to be read so the current value of the prox reading can be printed to the screen for setting the threshold.


goreleaser: update to version 2

Pull Request Test Coverage Report for Build<PHONE_NUMBER>8
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 0.0%

Totals

Change from base Build<PHONE_NUMBER>4:
0.0%

Covered Lines:
0

Relevant Lines:
0

💛  - Coveralls

Pull Request Test Coverage Report for Build<PHONE_NUMBER>2
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 0.0%

Totals

Change from base Build<PHONE_NUMBER>4:
0.0%

Covered Lines:
0

Relevant Lines:
0

💛  - Coveralls


Design Match Entry Document

The Match data will be stored in the hosted CouchDB server. Currently, the section Scout Input Interface Design from the README details more on exactly what metrics will be stored. The way the match type and number are stored is open to debate as it's tricky to make that easy from both a code and and end-user standpoint.
I'd like for a JSON document to be posted here detailing how all that data will be broken down.

General format, not including game-specific data.
{
    "event_match_key": "MAREA_SF2M2",

    "scouted_team": "4909",
    "scouted_by": "3467",
    "scout_intials": "AR",

    "brownout": false,
    "foul": false,
    "red_card": false,
    "yellow_card": false
}


Allow undefined type for isNaN

Search Terms
is:issue isNaN undefined
Suggestion
First of all - I've seen those other similar issues and I totally agree this should not allowed for all types.
But having it for undefined feels like a common use case.
I mean, what other use case is there if I can call it wit numbers only? All numbers are numbers, right?
Use Cases
I have a function that returns id of frame found on a page - if there is one - so the return type is number | undefined.
Using isNaN is a good way to check the returned value (which can be 0, which is still OK).
(as a workaround I will use Option monad which is probably much better solution, but still this would be nice to have)
Examples
const x: number | undefined = Math.random() > 0.5 ? 0 : undefined;
const notNumber: boolean = isNaN(x);

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[?] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

I mean, what other use case is there if I can call it wit numbers only? All numbers are numbers, right?

Guess you haven't seen this before?
var a = 0 / 0;
typeof a; // "number"
isNaN(a); // true

Detecting NaN is what isNaN is typically used for

@nmain good point. I should have checked the the docs before posting:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN

The isNaN() function determines whether a value is NaN or not.


[T2A1][T01-T2]Chua Ping Chan

Ready for review

@ChuaPingChan Some comments added. Please close the PR after reading comments.


Fixes punctuation on error message

Description
Just a quick fix on an error message that occurs when pyenv is not installed

Coverage remained the same at 71.961% when pulling 899929a67680d53c145521ddc3d069ec4c447ea2 on iMerica:master into 78bb301b43755a8627f5080386f966909db4eeec on Miserlou:master.


feat: app statistics

What does this PR do?

[ ] statistics UI

Related Ticket(s)

https://www.notion.so/console-labs/Listing-11a4fb55a3134ce291e72c526c72cfb0

Media (Loom or gif)

The mobile view seems incorrect. Although we don’t have a mobile version yet, can we still make adjustments to improve its appearance on mobile?

Move the title and desc in one line and the button in one line
Make the grid 2x2 instead of 3x3


Proposal to mxnet.metric

Motivation
mxnet.metric provides different methods for users to judge the performance of models. But currently there are some shortcomings which need to be improved in mxnet.metric. We propose to refactor the metrics interface to fix all issues and place the new interface under mx.gluon.metrics.
In general, we want to make the following improvements:

Moving the API to the gluon namespace
Make the API more user-friendly and pythonic
Structure the API to make hybridization of the complete training loop more easily feasible in the future.

1. Inconsistency in computational granularity of metrics
Currently there are two computational granularities in mxnet.metric:

“macro” level: calculate average performance per batch , like implementation in MAE
“micro” level: calculate average performance per sample, like implementation in Accuracy, CrossEntropy

Generally, “micro” level is more useful because usually we focus on average performance of data samples in the test set rather than that of testing batches. So here we need to make arrangements between these metrics.
2. For future hybridization of the complete training loop
Currently metrics in mxnet.metric receives “list of NDArray” and calculate results by numpy. In fact, many metrics’ computation could be implemented in nn.HybridBlock. Using HybridBlock.hybridize(), the computation could be done in the backend, which could be faster. By refactoring the mxnet.metric, we could one day compile the model with the metric like Tensorflow and do the complete training loop including evaluation fully in the backend. Thus our new API design takes into account the hybridization use-case, so that hybridizing the complete training loop will be easily possible once the backend support is there.
3. lacking some useful metrics
Although many metrics are already included, some still need to be implemented.
Apart from the metrics already provided in mxnet.metric: http://mxnet.incubator.apache.org/api/python/docs/api/metric/index.html?highlight=metric#module-mxnet.metric ,  we plan to add the following metrics:

F-beta score: (1+beta^2)precisionrecall/(beta^2*precision+recall)
binary accuracy with threshold: using a confidence threshold to judge whether the example is positive or negative
MeanCosineSimilarity: return the average cosin similarity between predictions and ground truth
MeanPairwiseDistance:  return the average pairwise distance between predictions and ground truth

4. Fixing issues in the existing metrics
Some special cases and input shapes need to be examined and fixed.
About EvalMetric (base class in metrics.py)

distinction between local and global:
a. Currently for metrics in metric.py, when update() is called, both local accumulator and global accumulator are updated with the same value.
b. Global accumulator may be useful when there are different parts during evaluation (for example, joint training on different datasets). You may want to get evaluation result of one part and call “reset_local()” to continue the evaluation for next part. In the end, you can call “get_global()” to obtain the overall evaluation performance.
c. You may also define the way to update local and global results in your own metric(EvalMetric)
parameter “output_names” “label_names” and method “update_dict”
a. Seemingly I only find “update_dict” in “https://github.com/apache/incubator-mxnet/blob/48e9e2c6a1544843ba860124f4eaa8e7bac6100b/python/mxnet/module/executor_group.py”, where I think using “update” is also reasonable.
b. I don’t know where the corresponding parameter "output_names","label_names" could be used, since there are not corresponding examples.
get_name_value()
a. return metric’s name and metric’s evalutaion value pairs.
b. It is helpful when using CompositeEvalMetric

Here are the detailed changes to be made:

improve Class MAE (and MSE, RMSE)
a. including parameter “average”, default average=“macro”
i. “macro” represents average per batch
ii. “micro” represents average per example
b. including micro level calculation:
improve Class _BinaryClassification
a. support the situation len(pred.shape)==1
i. for binary classification, we only need to output a confidence score of being positive, like: pred=[0.1,0.3,0.7] or like pred=[[0.1],[0.3],[0.7]]
b. including parameter “threshold”, default: threshold=0.5
i. sometimes we may need to define a threshold that when confidence(positive) > threshold, we classify it as positive, otherwise negative
c. including parameter “beta” default: beta=1
i. updating “fscore” calculation with F-beta= (1+beta^2)precisionrecall/(beta^2*precision+recall), which is more general
d. including method binary_accuracy:
i. calculation: (true_positives+true_negatives)/total_examples
improve Class TopKAccuracy
a. Line 578-579: self.global_sum_metric should be accumulated
add Class MeanCosineSimilarity(axis=-1, eps=1e-12)
add Class MeanPairwiseDistance(p=2)

Comparisons with other framework
Compared with Pytorch Ignite
Reference: https://pytorch.org/ignite/metrics.html
Base class for metrics is implemented independently. Metrics in ignite.metrics use .attach() method to use the output of the engine’s process_function. It is done by letting the engine to add_event_handler.
Metric arithmetics are supported, which is like mxnet.metrics.CustomMetric
Some metrics currently are not included in ours:

ConfusionMatrix
DiceCoefficient()
IoU()
mIoU()
MeanPairwiseDistance

Compared with Tensorflow Keras
Reference: https://tensorflow.google.cn/api_docs/python/tf/keras/metrics?hl=en
Base class for metrics inherits from tf.keras.engine.base_layer.Layer, which is also the class from which all layers inherit. Metric functions in tf.keras.metrics could be supplied in the metrics parameter when a model is compiled.
Generally, metric functions in tf.keras.metrics have an input sample_weight defining contributing weights when updating the states.
tf.keras.metrics use Accuracyand SparseCategoricalAccuracyto denote the situation that y_pred is predicted label and the situation that y_pred is probability distribution, which I think may be to avoid internal shape checking. Currently we could combine them in one metric.
Some metrics currently are not included in ours:

AUC
BinaryAccuracy
Hinge related, like SquaredHinge Hinge CategoricalHinge
CosineSimilarity
KLDivergence
LogCoshError :logcosh = log((exp(x) + exp(-x))/2), where x is the error (y_pred - y_true)
MeanIoU
Poisson
SensitivityAtSpecificity

I think we can also borrow ideas from the design in AllenNLP: https://github.com/allenai/allennlp/tree/master/allennlp/training/metrics

Also, I suggest to remove the option of macro averaging. I don't think the current implementation is correct. In scikit-learn, there is no macro option for MAE (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html#sklearn.metrics.mean_absolute_error), MSE (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html#sklearn.metrics.mean_squared_error). And for F1 score, the macro option is used for multi-label/multi-class prediction. See also: https://github.com/apache/incubator-mxnet/issues/9586#issuecomment-365427676

Here are the updated changes to be made:
1. improve Class MAE, MSE, RMSE
a. UPD: remove “macro” supports which represents average per batch
b. Rewrite RMSE to inherit from MSE
2. improve Class _BinaryClassification
a. UPD: including parameter “class_type” in [‘binary’, ‘multiclass’, ‘multilabel’]
b. support the situation len(pred.shape)==1 for class_type='binary'
     i. for binary classification, we only need to output a confidence score of being positive, like: pred=[0.1,0.3,0.7] or like pred=[[0.1],[0.3],[0.7]]
c. including parameter “threshold”, default: threshold=0.5
     i. sometimes we may need to define a threshold that when confidence(positive) > threshold, we classify it as positive, otherwise negative
     ii. used when class_type in [‘binary’, ‘multilabel’]
d. including parameter “beta” default: beta=1
     i. updating “fscore” calculation with F-beta= (1+beta^2)*precision*recall/(beta^2*precision+recall), which is more general
e. UPD: add cases for multillabel/multiclass
     i. including paramater ‘class_type’ in [‘binary’, ‘multilabel’, ‘multiclass’]
     ii. For ‘multilabel’, pred should be (N, ..., C) and label should be (N, ..., C)
     iii. For ‘multiclass’, pred should be (N, ..., C) and label should be (N, ...)
f. UPD: replace global_fscore with micro_fscore
3. add Class BinaryAccuracy(threshold=0.5)
4. add Class MeanCosineSimilarity(axis=-1, eps=1e-12)
5. add Class MeanPairwiseDistance(p=2)
6. improve Class F1:
a. F1(class_type="binary", threshold=0.5, average="micro")
b. average in [“binary”, “micro”, “macro”]:
     i. "macro": Calculate metrics for each label and return unweighted mean of f1.
     ii. "micro": Calculate metrics globally by counting the total TP, FN and FP.
     iii. None: Return f1 scores for each class (numpy.ndarray) .
7. add Class Fbeta(class_type="binary", beta=1, threshold=0.5, average="micro")
8. UPD: using mxnet.numpy instead of numpy

Closed by https://github.com/apache/incubator-mxnet/pull/18083


token/s speed

Based on the mixtral-moe branch, I was able to convert mixtral, as well as quantised it to int8. The speed of tks/s is similar to the benchmark, being 70 tokens/s on 2xA100.. However on longer prompts (my test cases comprise prompts of over 3000 tokens), the speed of tokens/s dramatically decreases to 6 tks/s.. why is that and is it possible to reduce the gap ?

@S-Yacer I didn't test with very long prompts, I suspect this is caused by prefill. I'll look at this issue further.

when removing prefill, im running into OOM rapidly.. or cuda related errors.

@S-Yacer I was not saying to remove prefill, I think we need more optimized implementation of prefill (when bs > 1). I have that code locally, but I need to fix my dev node firstly and update the mixtral-moe branch.

thank you ! I look forward to the update to test again ^ ^


BHBC-1688: Add survey radio field

Overview
Links to Jira tickets
https://quartech.atlassian.net/browse/BHBC-1688
Description of relevant changes
Add new radio field to survey.

Field is required (user must pick yes or no)

Bonus:
Add new git action to write openshift URLs to the PR.
PR Checklist
A list of items that are good to consider when making any changes.
Note: this list is not exhaustive, and not all items are always applicable.
Code

[ ] New files/classes/functions have appropriately descriptive names and comment blocks to describe their use/behaviour
[ ] I have avoided duplicating code when possible, moving re-usable pieces into functions
[ ] I have avoided hard-coding values where possible and moved any re-usable constants to a constants file
[ ] My code is as flat as possible (avoids deeply nested if/else blocks, promise chains, etc)
[ ] My code changes account for null/undefined values and handle errors appropriately
[ ] My code uses types/interfaces to help describe values/parameters/etc, help ensure type safety, and improve readability

Style

[ ] My code follows the established style conventions
[ ] My code uses native material-ui components/icons/conventions when possible

Documentation

[ ] I have commented my code sufficiently, such that an unfamiliar developer could understand my code
[ ] I have added/updated README's and related documentation, as needed

Tests

[ ] I have added/updated unit tests for any code I've added/updated
[ ] I have added/updated the Postman requests/tests to account for any API endpoints I've added/updated

Linting/Formatting

[ ] I have run the linter and fixed any issues, as needed
See the lint commands in package.json
[ ] I have run the formatter and fixed any issues, as needed
See the format commands in package.json

SonarCloud

[ ] I have addressed all SonarCloud Bugs, Vulnerabilities, Security Hotspots, and Code Smells

@jeznorth Wasn't 100% sure what you wanted project view UI to look like for the new field, so maybe double check it looks okay.


Cannot add periodic_task from admin

My tenant is named Company. When I try to add a periodic_task from the admin I get the error:

DoesNotExist at /admin/django_celery_beat/periodictask/add/
Company matching query does not exist.

Thoughts on how to fix this?

Sometimes the error is this:

IntegrityError at /admin/django_celery_beat/periodictask/add/
null value in column "periodic_task_id" violates not-null constraint
DETAIL:  Failing row contains (9, t, null, 5).

Really frustrated with this so any help would be very much appreciated.

I would need more information to be able to help. Is this happening on the public schema or a specific tenant? What's the full traceback? What does your project setup look like? It may be that this package or one of the other multitenancy packages is not configured correctly.
Most likely, your errors are coming from either the save or align methods here, if you wanted to look for clues: https://github.com/QuickRelease/django-tenants-celery-beat/blob/7787f94ea46fd3cf761f9c4924761fa45a18a6dc/django_tenants_celery_beat/models.py#L24


Add support for MOI 0.10 and drop Julia < 1.6

This PR adds support for MOI 0.10. It can't be tested on Julia 1.0 (see https://github.com/JuliaOptimalTransport/ExactOptimalTransport.jl/pull/7) and hence I dropped support for older Julia versions < 1.6. This seems safe to do now that Julia 1.6 is the LTS. It is also in line with other major parts of the Julia ecosystem such as SciML: https://sciml.ai/news/2021/12/02/lts/index.html

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 97.006%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
162

Relevant Lines:
167

💛  - Coveralls

Codecov Report

Merging #18 (3adc7f3) into main (ada5933) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   97.00%   97.00%
=======================================
  Files           4        4
  Lines         167      167
=======================================
  Hits          162      162
  Misses          5        5

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ada5933...3adc7f3. Read the comment docs.


DISTMYSQL-141: cluster-osc-slaves API may not return all required slaves

https://jira.percona.com/browse/DISTMYSQL-141

https://ps80.cd.percona.com/job/mysql-orchestrator-pipeline/27/


fix railtie for our jobs folder

fixed dashing rails because it preloads the jobs folder and ours contains constants that aren't available before loading the initializers ...
(load order is gems -> initializers -> code)

not good. do better

where's the ☕  related functions?

Merged.


Integrate with Waffle.io

@rultor merge

@rultor merge

@valery1707 OK, I'll try to merge now. You can check the progress of the merge here

@rultor merge

@valery1707 Done! FYI, the full log is here (took me 2min)


Update Composer dependencies (2021-01-19-00-08)

Visual regression test passed!
View the visual regression test report

Visual regression test passed!
View the visual regression test report


Add defensive checks for NUL bytes in input strings

If an input string contains a NUL byte, then the JNI string->char* conversion will get confused, and libpostal hangs in the native method call.  This PR adds defensive checks to AddressParser and AddressExpander to prevent this.

Thanks for the PR but this is actually a slightly more general problem. Wasn't aware of this, but apparently JNI uses a "modified UTF-8" (b/c Java needs to reinvent all of the wheels...), instead of standard UTF-8, which is required by libpostal. In addition to the NUL-byte terminator, it converts 4-byte UTF-8 sequences into two 3-byte surrogate pairs, which I'm not sure if utf8proc, our decoder, would handle correctly.
So I think I'd prefer to convert the strings to real UTF-8 byte arrays and just NUL-terminate them at the C/JNI level.


Look at how bundler packages rake tasks

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

Our load approach (documented in https://github.com/fulldecent/lightning-sites/blob/master/README.md) is fine, we don't need to change it.


Define job groups in cluster config.yaml

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I would like to set job groups in the cluster config.yaml file instead of in the rules. This would make it easier to keep the overview + it is a parameter that is specific to a cluster's resources so naturally it would find its place in the cluster config.yaml. At the moment I can only get job-grouping to work using this inside rules:
rule salmon:
    input:
        read1 = rules.trim_galore.output.fastq_read1,
        read2 = rules.trim_galore.output.fastq_read2,
    output:
        genes_quantification = os.path.join(config['Directories']['analyzed_dir'], 'salmon_{sample}', 'quant.genes.sf'),
    threads: 12
    conda:
        "../envs/salmon.yaml"
    params:
        salmon_index = os.path.join(config['Global_directories']['reference_files'], config['References']['salmon_index']),
        gtf_file = os.path.join(config['Global_directories']['reference_files'], config['References']['gtf_file']),
    group:
        "quantification"
    shell:
        '''
        salmon quant \
        --index {params.salmon_index} \
        --geneMap {params.gtf_file} \
        --libType A \
        --mates1 {input.read1} \
        --mates2 {input.read2} \
        --validateMappings \
        --threads {threads} \
        --output {config[Directories][analyzed_dir]}/salmon_{wildcards.sample}
        '''

Describe the solution you'd like
It would be nice if I could set the groups inside the cluster.yaml file, perhaps in the set-resources section, like to:
set-resources:
  salmon:
    mem_mb: 20000 # This seems to work, but can we do with less?
    runtime: 600
    group: "quantification"
  TPM_normalization:
    group: "quantification"

Describe alternatives you've considered
Perhaps this can already be done, and I'm implementing it wrong but I have read all relevant documentation as far as I am aware.
Additional context

Consider this: The group job is a property of the workflow itself. Snakemake allows for group jobs to supported piped information flow. To rely on profiles to provide such information can break a workflow.
On the other hand, every property of a workflow can be defined on the command line, too. And in configuration files. I did not test this for group jobs, because I would not recommend it for the reason named above.
Besides, this is a property of Snakemake. This plugin repo only contains the code for job submissions using the SLURM batch system. Snakemake issues should be reported in the Snakemake repository.


Fix improper use of Requests for file upload

The data structure prepared by format_file_params is supposed to be a list of tuples with a certain structure, not the dict one created currently. See https://github.com/HelloFax/hellosign-python-sdk/issues/34 for details of the issue being addressed here.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


PEP343 conformance

Hi blueyonder
It would be nice to be able to have a PEP343  compliant turbodbc connection.
This way, I could write something like:
with turbodbc.connect('...') as conn:
Thank you for your useful and great project

Hi there! Makes sense to me, and I have the feeling that this would make for a nice and easy contribution :-).


[Feature] AppRollout get rid of appContext

Is your feature request related to a problem? Please describe.
Now, the appRollout rely on appContext to prepare workload.
By deprecating appContext appRollout should get rid of appContext too.
Describe the solution you'd like
1.application controller take the responsibility to prepare workload for appRollout
2.modify appRollout logic to update application's annotation to trigger prepare workload for AppRollout
Describe alternatives you've considered
Now, an appContext map to an appRev. I'm not sure only an application map to all appRevs weather have problem.

I found out updating application annotation to trigger might not work, because our rollout embed application controller  logic will call appRollout reconcile func.

Has been fixed by https://github.com/oam-dev/kubevela/pull/1774


[api-minor] Moving text layer rendering into src/display and better "text" testing.

Combines page rendering and text layer in the "text" tests.
(thuluthfont-text test was removed due to invalid unicode characters in the text nodes)

/botio test

Made #textLayer=visible match to new "text" test output.
/botio-linux preview

I would say that this fixes #4576.

@yurydelendik Could you rebase this PR?

/botio makeref


Add a bytes column to the Packet Header and Format table

The only thing that is clear is that the crc is 1 byte.

Hmmm, I think the Offset is probably in bytes after looking at the code.