before_code
stringlengths
14
465k
reviewer_comment
stringlengths
16
64.5k
after_code
stringlengths
9
467k
diff_context
stringlengths
0
97k
file_path
stringlengths
5
226
comment_line
int32
0
26
language
stringclasses
37 values
quality_score
float32
0.07
1
comment_type
stringclasses
9 values
comment_length
int32
16
64.5k
before_lines
int32
1
17.2k
after_lines
int32
1
12.1k
is_negative
bool
2 classes
pr_title
stringlengths
1
308
pr_number
int32
1
299k
repo_name
stringclasses
533 values
repo_stars
int64
321
419k
repo_language
stringclasses
27 values
reviewer_username
stringlengths
0
39
author_username
stringlengths
2
39
episode.autoDownloadStatus = previousStatus } else { episode.autoDownloadStatus = Settings.downloadUpNextEpisodes() ? AutoDownloadStatus.autoDownloaded.rawValue : AutoDownloadStatus.playerDownloadedForStreaming.rawValue } let downloadTaskUUID = episode.uuid if d...
No issues found.
episode.autoDownloadStatus = previousStatus } else { episode.autoDownloadStatus = Settings.downloadUpNextEpisodes() ? AutoDownloadStatus.autoDownloaded.rawValue : AutoDownloadStatus.playerDownloadedForStreaming.rawValue } let downloadTaskUUID = episode.uuid if d...
@@ -90,7 +90,11 @@ class DownloadManager: NSObject, FilePathProtocol { lazy var wifiOnlyBackgroundSession: URLSession = { var config = URLSessionConfiguration.background(withIdentifier: "au.com.shiftyjelly.PCBackgroundSession") - config.allowsExpensiveNetworkAccess = false + if FeatureFlag...
podcasts/DownloadManager.swift
0
Swift
1
none
16
51
51
true
Switch to allowsCellularAccess from allowsExpensiveNetworkAccess
3,833
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
ServerSettings.syncingV2Token = token ServerSettings.setRefreshToken(refreshedRefreshToken) } else { if isApplicationBackgrounded() { FileLog.shared.addMessage("TokenHelper: Skipped logout in background due to error: \(String(describing: error))") ...
No issues found.
ServerSettings.syncingV2Token = token ServerSettings.setRefreshToken(refreshedRefreshToken) } else { if isApplicationBackgrounded() { FileLog.shared.addMessage("TokenHelper: Skipped logout in background due to error: \(String(describing: error))") ...
@@ -109,17 +109,13 @@ class TokenHelper { if isApplicationBackgrounded() { FileLog.shared.addMessage("TokenHelper: Skipped logout in background due to error: \(String(describing: error))") } else { - if ServerConfig.avoidLogoutOnError { - // i...
Modules/Server/Sources/PocketCastsServer/Private/TokenHelper.swift
0
Swift
1
none
16
51
51
true
Feature Flag: Remove `error_logout_handling` feature flag
3,854
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
.background(theme.support02) .tint(theme.primaryUi01) .frame(width: iconSize, height: iconSize) .clipShape(Circle()) .opacity(viewModel.isSubscribed ? 1 : 0) } .overlay...
No issues found.
.background(theme.support02) .tint(theme.primaryUi01) .frame(width: iconSize, height: iconSize) .clipShape(Circle()) .opacity(viewModel.isSubscribed ? 1 : 0) } .overlay...
@@ -33,7 +33,7 @@ struct PodcastHeaderView: View { var body: some View { VStack(spacing: 0) { - Spacer().frame(height: 16) + Spacer().frame(height: titleBottomMargin) HStack(alignment: .top) { Spacer() PodcastImageViewWrapper(podcastUU...
podcasts/PodcastHeaderView.swift
0
Swift
1
none
16
51
51
true
Dynamic type: podcast view
3,892
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
folderInfo.adjustsFontForContentSizeCategory = true } } @IBOutlet var unplayedBadge: UnplayedBadge! @IBOutlet var unplayedHeight: NSLayoutConstraint! private var badgeType: BadgeType = .off override func awakeFromNib() { super.awakeFromNib() isAccessibilityElem...
No issues found.
folderInfo.adjustsFontForContentSizeCategory = true } } @IBOutlet var unplayedBadge: UnplayedBadge! @IBOutlet var unplayedHeight: NSLayoutConstraint! private var badgeType: BadgeType = .off override func awakeFromNib() { super.awakeFromNib() isAccessibilityElem...
@@ -8,22 +8,34 @@ class FolderListCell: ThemeableCollectionCell { } } - @IBOutlet var folderName: ThemeableLabel! + @IBOutlet var folderName: ThemeableLabel! { + didSet { + folderName.font = UIFont.font(ofSize: 16, weight: .medium, scalingWith: .callout) + folderName.a...
podcasts/FolderListCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Podcasts list
3,914
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
currentTime = PlaybackManager.shared.currentTime() } else { duration = 1 currentTime = 1 } guard duration > 0, currentTime.isFinite else { return } let remaining = duration - currentTime timeRemainingLabel.text = L10n.queueTimeRemaini...
No issues found.
currentTime = PlaybackManager.shared.currentTime() } else { duration = 1 currentTime = 1 } guard duration > 0, currentTime.isFinite else { return } let remaining = duration - currentTime timeRemainingLabel.text = L10n.queueTimeRemaini...
@@ -21,6 +21,7 @@ class UpNextNowPlayingCell: ThemeableCell { @IBOutlet var dateLabel: ThemeableLabel! { didSet { dateLabel.style = .primaryText02 + dateLabel.font = UIFont.font(ofSize: 12, weight: .semibold, scalingWith: .caption1) } } @@ -34,12 +35,14 @@ class UpN...
podcasts/UpNextNowPlayingCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update UpNext section
3,918
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
let columns = try db.columns(in: DataManager.folderTableName) return Set(columns.map { $0.name }) } // The database should have at least all the columns from columnNames let missingColumns = columnNames.subtracting(tableColumns) XCTAssertTrue( missing...
No issues found.
let columns = try db.columns(in: DataManager.folderTableName) return Set(columns.map { $0.name }) } // The database should have at least all the columns from columnNames let missingColumns = columnNames.subtracting(tableColumns) XCTAssertTrue( missing...
@@ -0,0 +1,104 @@ +import XCTest +import GRDB +@testable import PocketCastsDataModel +@testable import PocketCastsUtils + +/// Tests to ensure the legacy SQL columnNames and GRDB-persisted columns remain in sync. +/// These tests prevent the issue where GRDB might persist a field that the legacy SQL path ignores +/// (...
Modules/DataModel/Tests/PocketCastsDataModelTests/FolderColumnConsistencyTests.swift
0
Swift
1
none
16
51
51
true
GRDB Macros: Folder
3,920
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
XCTAssertEqual(loaded.hasCustomImage, original.hasCustomImage, "\(implementationName): hasCustomImage should match") XCTAssertEqual(loaded.cachedFrameCount, original.cachedFrameCount, "\(implementationName): cachedFrameCount should match") XCTAssertEqual(loaded.playingStatusModified,...
No issues found.
XCTAssertEqual(loaded.hasCustomImage, original.hasCustomImage, "\(implementationName): hasCustomImage should match") XCTAssertEqual(loaded.cachedFrameCount, original.cachedFrameCount, "\(implementationName): cachedFrameCount should match") XCTAssertEqual(loaded.playingStatusModified,...
@@ -0,0 +1,191 @@ +import XCTest +import GRDB +@testable import PocketCastsDataModel +@testable import PocketCastsUtils + +/// Tests to ensure the legacy SQL columnNames and GRDB-persisted columns remain in sync. +/// These tests prevent the issue where GRDB might persist a field that the legacy SQL path ignores +/// (...
Modules/DataModel/Tests/PocketCastsDataModelTests/UserEpisodeColumnConsistencyTests.swift
0
Swift
1
none
16
51
51
true
GRDB Macros: User Episodes
3,921
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
} // MARK: - firstSortPositionForPlaylist Tests func testFirstSortPositionForPlaylistReturnsMinPosition() throws { try runWithBothImplementations { dataManager, impl in _ = self.createTestPlaylist(name: "Playlist 1", sortPosition: 5, dataManager: dataManager) _ = self.creat...
No issues found.
} // MARK: - firstSortPositionForPlaylist Tests func testFirstSortPositionForPlaylistReturnsMinPosition() throws { try runWithBothImplementations { dataManager, impl in _ = self.createTestPlaylist(name: "Playlist 1", sortPosition: 5, dataManager: dataManager) _ = self.creat...
@@ -374,4 +374,122 @@ final class PlaylistDataManagerTests: DataManagerTestCase { XCTAssertNotNil(found?.playlistUpdateDate, "\(impl): Should have update date") } } + + // MARK: - save Tests (PersistableRecord API) + + func testSaveInsertsNewPlaylistWithAllFields() throws { + try...
Modules/DataModel/Tests/PocketCastsDataModelTests/PlaylistDataManagerTests.swift
0
Swift
1
none
16
51
51
true
GRDB Macros: EpisodeFilter
3,923
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
func testSearchPodcastsMatchesAuthor() throws { try runWithBothImplementations { dataManager, impl in _ = self.createTestPodcast(title: "Podcast 1", author: "John Smith", dataManager: dataManager) _ = self.createTestPodcast(title: "Podcast 2", author: "Jane Doe", dataManager: dataMan...
No issues found.
func testSearchPodcastsMatchesAuthor() throws { try runWithBothImplementations { dataManager, impl in _ = self.createTestPodcast(title: "Podcast 1", author: "John Smith", dataManager: dataManager) _ = self.createTestPodcast(title: "Podcast 2", author: "Jane Doe", dataManager: dataMan...
@@ -857,6 +857,126 @@ final class PodcastDataManagerTests: DataManagerTestCase { } } + // MARK: - save Tests (PersistableRecord API) + + func testSaveInsertsNewPodcastWithAllFields() throws { + try runWithBothImplementations { dataManager, impl in + let podcast = Podcast() + ...
Modules/DataModel/Tests/PocketCastsDataModelTests/PodcastDataManagerTests.swift
0
Swift
1
none
16
51
51
true
GRDB Macros: Podcast
3,924
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
} optionPicker.addAction(action: sortAction) let currentGroup = podcast.podcastGrouping().description let groupAction = OptionAction(label: L10n.groupEpisodes, secondaryLabel: currentGroup, icon: "option-group") { [weak self] in guard let strongSelf = self else { return } ...
No issues found.
} optionPicker.addAction(action: sortAction) let currentGroup = podcast.podcastGrouping().description let groupAction = OptionAction(label: L10n.groupEpisodes, secondaryLabel: currentGroup, icon: "option-group") { [weak self] in guard let strongSelf = self else { return } ...
@@ -29,20 +29,6 @@ class EpisodeListSearchController: SimpleNotificationsViewController, UISearchBa } } - @IBOutlet var archivedInfoLabel: ThemeableLabel! { - didSet { - archivedInfoLabel.style = .primaryText02 - archivedInfoLabel.font = UIFont.font(ofSize: 14, weight: .r...
podcasts/EpisodeListSearchController.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update text limits
3,929
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
@IBOutlet var iconView: UIImageView! @IBOutlet var podcastImage: PodcastImageView! @IBOutlet var titleLabel: UILabel! { didSet { titleLabel.font = UIFont.font(ofSize: 16.0, weight: .medium, scalingWith: .callout) } } @IBOutlet var addIcon: TintableImageView! { di...
No issues found.
@IBOutlet var iconView: UIImageView! @IBOutlet var podcastImage: PodcastImageView! @IBOutlet var titleLabel: UILabel! { didSet { titleLabel.font = UIFont.font(ofSize: 16.0, weight: .medium, scalingWith: .callout) } } @IBOutlet var addIcon: TintableImageView! { di...
@@ -24,6 +24,7 @@ class SiriShortcutAddCell: ThemeableCell { podcastImage.isHidden = false iconView.isHidden = true + updateSize() } func populateFrom(filter: EpisodeFilter) { @@ -32,5 +33,26 @@ class SiriShortcutAddCell: ThemeableCell { iconView.tintColor = filter.playli...
podcasts/SiriShortcutAddCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update siri settings
3,930
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
} func populateFrom(model: FolderModel) { setup(folderName: model.nameForFolder(), folderColor: Int32(model.colorInt), topPodcastUuids: model.selectedPodcastUuids) } func populateFrom(suggestedFolder folder: SuggestedFolder) { setup(folderName: folder.name, folderColor: folder.color, t...
No issues found.
} func populateFrom(model: FolderModel) { setup(folderName: model.nameForFolder(), folderColor: Int32(model.colorInt), topPodcastUuids: model.selectedPodcastUuids) } func populateFrom(suggestedFolder folder: SuggestedFolder) { setup(folderName: folder.name, folderColor: folder.color, t...
@@ -125,7 +125,8 @@ class FolderPreviewView: UIView { label.numberOfLines = 1 label.textColor = UIColor.white label.textAlignment = .center - label.font = UIFont.systemFont(ofSize: 11, weight: .semibold) + label.font = UIFont.font(ofSize: ...
podcasts/FolderPreviewView.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update podcast grid cells
3,931
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
import Foundation /// A format style for trimming a TimeInterval to Significant Digits public struct SignificantDigitsFormatStyle: FormatStyle { public let significantDigits: Int public init(significantDigits: Int) { self.significantDigits = significantDigits } public func format(_ value: Tim...
No issues found.
import Foundation /// A format style for trimming a TimeInterval to Significant Digits public struct SignificantDigitsFormatStyle: FormatStyle { public let significantDigits: Int public init(significantDigits: Int) { self.significantDigits = significantDigits } public func format(_ value: Tim...
@@ -11,6 +11,7 @@ public struct SignificantDigitsFormatStyle: FormatStyle { public func format(_ value: TimeInterval) -> String { let formatter = NumberFormatter() formatter.numberStyle = .decimal + formatter.usesGroupingSeparator = false formatter.usesSignificantDigits = true ...
Modules/Utils/Sources/PocketCastsUtils/Formatting/SignificantDigitsFormatStyle.swift
0
Swift
1
none
16
32
32
true
Handle new podcast URL format
3,937
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
struct DescriptiveActionAttributedTextView: View { @EnvironmentObject var theme: Theme @Environment(\.openURL) var openURL private let text: String private let onLinkTap: (() -> Void)? init(text: String, onLinkTap: (() -> Void)? = nil) { self.text = text self.onLinkTap = onLinkTap...
No issues found.
struct DescriptiveActionAttributedTextView: View { @EnvironmentObject var theme: Theme @Environment(\.openURL) var openURL private let text: String private let onLinkTap: (() -> Void)? init(text: String, onLinkTap: (() -> Void)? = nil) { self.text = text self.onLinkTap = onLinkTap...
@@ -15,6 +15,7 @@ struct DescriptiveActionAttributedTextView: View { var body: some View { Text(makeAttributedString()) .multilineTextAlignment(.center) + .fixedSize(horizontal: false, vertical: true) .foregroundColor(theme.primaryText01) .environment(\.op...
podcasts/DescriptiveActionAttributedTextView.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Options controller
3,938
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
view.addSubview(playlistNameTextField) saveButton = UIButton(type: .custom) view.addSubview(saveButton) var constraints = [ textFieldBorderView.topAnchor.constraint(equalTo: playlistNameTextField.topAnchor, constant: -8.0), textFieldBorderView.leadingAnchor.cons...
No issues found.
view.addSubview(playlistNameTextField) saveButton = UIButton(type: .custom) view.addSubview(saveButton) var constraints = [ textFieldBorderView.topAnchor.constraint(equalTo: playlistNameTextField.topAnchor, constant: -8.0), textFieldBorderView.leadingAnchor.cons...
@@ -39,7 +39,8 @@ class NewPlaylistViewController: PCViewController { playlistNameTextField.clearsOnBeginEditing = false playlistNameTextField.clearButtonMode = .whileEditing playlistNameTextField.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 8) - play...
podcasts/New Creation/New Playlist/NewPlaylistViewController.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] - Playlists List
3,946
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
@IBOutlet var plusView: ThemeableView! { didSet { plusView.style = .primaryUi02 } } @IBOutlet var noPlusView: ThemeableView! { didSet { noPlusView.style = .primaryUi02 let tapGesture = UITapGestureRecognizer(target: self, action: #selector(header...
No issues found.
@IBOutlet var plusView: ThemeableView! { didSet { plusView.style = .primaryUi02 } } @IBOutlet var noPlusView: ThemeableView! { didSet { noPlusView.style = .primaryUi02 let tapGesture = UITapGestureRecognizer(target: self, action: #selector(header...
@@ -5,15 +5,25 @@ import UIKit class UploadedStorageHeaderView: UIView { @IBOutlet var contentView: UIView! + @IBOutlet var noFilesLabel: ThemeableLabel! { + didSet { + noFilesLabel.style = .primaryText02 + noFilesLabel.font = UIFont.font(ofSize: 12, weight: .semibold, scalingWit...
podcasts/UploadedStorageHeaderView.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Uploaded files
3,953
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
import UIKit class StatsCell: ThemeableCell { @IBOutlet var statsIcon: UIImageView! @IBOutlet var statName: UILabel! @IBOutlet var statValue: ThemeableLabel! { didSet { statValue.style = .primaryText02 } } override func awakeFromNib() { super.awakeFromNib() ...
No issues found.
import UIKit class StatsCell: ThemeableCell { @IBOutlet var statsIcon: UIImageView! @IBOutlet var statName: UILabel! @IBOutlet var statValue: ThemeableLabel! { didSet { statValue.style = .primaryText02 } } override func awakeFromNib() { super.awakeFromNib() ...
@@ -10,6 +10,11 @@ class StatsCell: ThemeableCell { } } + override func awakeFromNib() { + super.awakeFromNib() + updateSize() + } + @IBOutlet var leadingSpaceToIcon: NSLayoutConstraint! func hideIcon() { @@ -28,4 +33,20 @@ class StatsCell: ThemeableCell { override...
podcasts/StatsCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update stats view controller
3,955
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
private func setSelectedState(selected: Bool) { switch playState { case .currentlyPlaying, .currentlyPaused: isPlayingView.backgroundColor = selected ? ThemeColor.playerContrast05() : ThemeColor.playerContrast06() case .played, .future: backgroundColor = selected ? T...
No issues found.
private func setSelectedState(selected: Bool) { switch playState { case .currentlyPlaying, .currentlyPaused: isPlayingView.backgroundColor = selected ? ThemeColor.playerContrast05() : ThemeColor.playerContrast06() case .played, .future: backgroundColor = selected ? T...
@@ -3,9 +3,25 @@ import PocketCastsDataModel import UIKit class PlayerChapterCell: UITableViewCell { - @IBOutlet var chapterName: UILabel! - @IBOutlet var chapterLength: UILabel! - @IBOutlet var chapterNumber: UILabel! + @IBOutlet var chapterName: UILabel! { + didSet { + chapterName.fo...
podcasts/PlayerChapterCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update Player chapters
3,957
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
@IBOutlet var numberWidth: NSLayoutConstraint! @IBOutlet var podcastImageLeadingConstraint: NSLayoutConstraint! private var discoverPodcast: DiscoverPodcast? deinit { NotificationCenter.default.removeObserver(self) } override func setSelected(_ selected: Bool, animated: Bool) { ...
No issues found.
@IBOutlet var numberWidth: NSLayoutConstraint! @IBOutlet var podcastImageLeadingConstraint: NSLayoutConstraint! private var discoverPodcast: DiscoverPodcast? deinit { NotificationCenter.default.removeObserver(self) } override func setSelected(_ selected: Bool, animated: Bool) { ...
@@ -17,16 +17,28 @@ class DiscoverPodcastTableCell: ThemeableCell { } } - @IBOutlet var podcastTitle: UILabel! + @IBOutlet var podcastTitle: UILabel! { + didSet { + podcastTitle.font = .font(ofSize: 15, weight: .medium, scalingWith: .subheadline) + podcastTitle.adjusts...
podcasts/DiscoverPodcastTableCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Discovery - Feature cells
3,959
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
for task in backgroundTasks { switch task { case let refreshTask as WKApplicationRefreshBackgroundTask: if WatchSyncManager.shared.isPlusUser() { FileLog.shared.addMessage("Watch Extension Delegate start application refresh background task") ...
No issues found.
for task in backgroundTasks { switch task { case let refreshTask as WKApplicationRefreshBackgroundTask: if WatchSyncManager.shared.isPlusUser() { FileLog.shared.addMessage("Watch Extension Delegate start application refresh background task") ...
@@ -1,17 +1,28 @@ +import AutomatticRemoteLogging import PocketCastsDataModel import PocketCastsServer import PocketCastsUtils import WatchKit class ExtensionDelegate: NSObject, WKApplicationDelegate { private var haveAttemptedStateRestore = false + private var crashLogging: CrashLogging? func app...
Pocket Casts Watch App/ExtensionDelegate.swift
0
Swift
1
none
16
51
51
true
[Watch + Up Next] watchOS Sentry logging
3,965
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
let decreaseSpeedRequest = [WatchConstants.Messages.messageType: WatchConstants.Messages.DecreaseSpeedRequest.type] as [String: Any] WCSession.default.sendMessage(decreaseSpeedRequest, replyHandler: nil) } func changeSpeedInterval() { guard validateSessionActivated() else { return } ...
No issues found.
let decreaseSpeedRequest = [WatchConstants.Messages.messageType: WatchConstants.Messages.DecreaseSpeedRequest.type] as [String: Any] WCSession.default.sendMessage(decreaseSpeedRequest, replyHandler: nil) } func changeSpeedInterval() { guard validateSessionActivated() else { return } ...
@@ -1,5 +1,6 @@ import Foundation import PocketCastsDataModel +import PocketCastsUtils import WatchConnectivity import WatchKit @@ -13,6 +14,7 @@ extension SessionManager { } func play(episode: BaseEpisode, playlist: AutoplayHelper.Playlist?) { + guard validateSessionActivated() else { return }...
Pocket Casts Watch App/SessionManager+Send.swift
0
Swift
1
none
16
51
51
true
[Watch + Up Next] Watch sync API updates
3,968
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
return gradientView }() private lazy var activityIndicator: UIActivityIndicatorView = { let indicator = UIActivityIndicatorView(style: .medium) indicator.translatesAutoresizingMaskIntoConstraints = false indicator.color = .black indicator.hidesWhenStopped = true ...
No issues found.
return gradientView }() private lazy var activityIndicator: UIActivityIndicatorView = { let indicator = UIActivityIndicatorView(style: .medium) indicator.translatesAutoresizingMaskIntoConstraints = false indicator.color = .black indicator.hidesWhenStopped = true ...
@@ -38,7 +38,8 @@ class GeneratedTranscriptsPremiumOverlay: UIViewController, AnalyticsSourceProvi title.translatesAutoresizingMaskIntoConstraints = false title.text = L10n.generatedTranscriptsOverlayTitle title.numberOfLines = 0 - title.font = .systemFont(ofSize: 22, weight: .bold) + ...
podcasts/GeneratedTranscriptsPremiumOverlay.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Transcript update actions and paywall
3,969
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
if let messageId = applicationContext[WatchConstants.Keys.messageVersion] as? String, messageId == WatchConstants.Values.messageVersion { UserDefaults.standard.set(applicationContext, forKey: WatchConstants.UserDefaults.data) UserDefaults.standard.set(Date(), forKey: WatchConstants.UserD...
No issues found.
if let messageId = applicationContext[WatchConstants.Keys.messageVersion] as? String, messageId == WatchConstants.Values.messageVersion { UserDefaults.standard.set(applicationContext, forKey: WatchConstants.UserDefaults.data) UserDefaults.standard.set(Date(), forKey: WatchConstants.UserD...
@@ -60,9 +60,33 @@ class SessionManager: NSObject, WCSessionDelegate { guard let messageType = message[WatchConstants.Messages.messageType] as? String else { return } if WatchConstants.Messages.LogFileRequest.type == messageType { - FileLog.shared.loadLogFileAsString { logContents in - ...
Pocket Casts Watch App/SessionManager.swift
0
Swift
1
none
16
51
51
true
[Watch + Up Next] Send file watchOS log + add to LogsView
3,971
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
super.awakeFromNib() updateSize() } func setSelectedState(_ selected: Bool) { podcastImage.alpha = selected ? 0.6 : 1.0 } func populateFrom(_ discoverPodcast: DiscoverPodcast, isSubscribed: Bool) { self.discoverPodcast = discoverPodcast if let title = discoverPo...
No issues found.
super.awakeFromNib() updateSize() } func setSelectedState(_ selected: Bool) { podcastImage.alpha = selected ? 0.6 : 1.0 } func populateFrom(_ discoverPodcast: DiscoverPodcast, isSubscribed: Bool) { self.discoverPodcast = discoverPodcast if let title = discoverPo...
@@ -4,6 +4,12 @@ import PocketCastsUtils import UIKit class SmallListCell: ThemeableCollectionCell { + + static var scaledHeight: CGFloat { + let metric = UIFontMetrics(forTextStyle: .callout) + return max(52, metric.scaledValue(for: 52)) + } + @IBOutlet var podcastImage: PodcastImageView! ...
podcasts/SmallListCell.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Discover trending list
3,975
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
let label = ThemeableLabel() label.font = .font(ofSize: 15, weight: .medium, scalingWith: .title1) label.textColor = ThemeColor.primaryText02() label.adjustsFontForContentSizeCategory = true return label }() private let bottomLabel: ThemeableLabel = { let label =...
No issues found.
let label = ThemeableLabel() label.font = .font(ofSize: 15, weight: .medium, scalingWith: .title1) label.textColor = ThemeColor.primaryText02() label.adjustsFontForContentSizeCategory = true return label }() private let bottomLabel: ThemeableLabel = { let label =...
@@ -25,16 +25,18 @@ class LargeListSummaryCellHeaderView: UIView { private let topLabel: ThemeableLabel = { let label = ThemeableLabel() - label.font = .systemFont(ofSize: 15, weight: .medium) + label.font = .font(ofSize: 15, weight: .medium, scalingWith: .title1) label.textColor ...
podcasts/LargeListSummaryCellHeaderView.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Discover large list
3,977
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
} struct SubscribeButtonView: View { @EnvironmentObject var theme: Theme @ObservedObject var model: SubscribeButtonModel init(podcastUuid: String, source: AnalyticsSource, onSubscribe: (() -> Void)? = nil) { self.model = SubscribeButtonModel(podcastUuid: podcastUuid, source: source, subscribeBloc...
No issues found.
} struct SubscribeButtonView: View { @EnvironmentObject var theme: Theme @ObservedObject var model: SubscribeButtonModel init(podcastUuid: String, source: AnalyticsSource, onSubscribe: (() -> Void)? = nil) { self.model = SubscribeButtonModel(podcastUuid: podcastUuid, source: source, subscribeBloc...
@@ -59,7 +59,7 @@ struct SubscribeButtonView: View { .foregroundColor(AppTheme.color(for: .primaryIcon02, theme: theme)) } } - .frame(width: 48, height: 48) + .frame(width: 32, height: 32) } .buttonStyle(SubscribeButtonStyle(...
podcasts/New Search/Views/Results/RoundedSubscribeButtonView.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Discover network highlight cell
3,979
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
/// Uses the PlaylistMetadataLoader cache before running the query (the query will update when it's done) case playlistDataCacheBeforeQuery /// Avoid returning cached episode early and use policy instead case episodesInfoCacheReloadPolicy /// Ignores play remote commands when other audio is playin...
No issues found.
/// Uses the PlaylistMetadataLoader cache before running the query (the query will update when it's done) case playlistDataCacheBeforeQuery /// Avoid returning cached episode early and use policy instead case episodesInfoCacheReloadPolicy /// Ignores play remote commands when other audio is playin...
@@ -286,6 +286,9 @@ public enum FeatureFlag: String, CaseIterable { /// Use WCSessionFileTransfer to send logs from watchOS to iPhone instead of sendMessage reply case watchLogFileTransfer + /// Check if protected data is available before running migrations that touch keychain + case checkProtectedDat...
Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift
0
Swift
1
none
16
51
51
true
Skip migrations when User Defaults is unavailable
3,983
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
} } return cell } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let podcast = podcasts[indexPath.row] delegate?.show(discoverPodcast: podcast, placeholderImage: nil, isFeatured: false, listUuid: ...
No issues found.
} } return cell } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let podcast = podcasts[indexPath.row] delegate?.show(discoverPodcast: podcast, placeholderImage: nil, isFeatured: false, listUuid: ...
@@ -73,7 +73,7 @@ extension ExpandedCollectionViewController: UICollectionViewDataSource, UICollec return CGSize(width: viewWidth, height: descriptiveListPreferredMaxHeight) case .grid: let itemWidth = (viewWidth - (gridStyleSpacing * (gridNumColumns - 1))) / gridNumColumn...
podcasts/ExpandedCollectionViewController+CollectionView.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Network highlight - Show all
3,985
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
} override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) Analytics.track(.settingsSelectPodcastsDismissed, properties: ["source": analyticsSource]) if didChange { delegate?.didChangePodcasts(numberSelected: selectedUuids.count) } } ...
No issues found.
} override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) Analytics.track(.settingsSelectPodcastsDismissed, properties: ["source": analyticsSource]) if didChange { delegate?.didChangePodcasts(numberSelected: selectedUuids.count) } } ...
@@ -81,6 +81,14 @@ class PodcastChooserViewController: PCViewController, UITableViewDelegate, UITab return podcastCell } + func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + guard let podcastCell = cell as? PodcastChooserCell else { +...
podcasts/PodcastChooserViewController.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Fix podcast selection
3,988
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
highlightAddBookmarksIfNeeded() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setPreferredSize(animated: false) } @objc func appDidBecomeActive() { actionsTable.reloadData() } @IBAction func doneTapped(_ sender: UIButton) { ...
No issues found.
highlightAddBookmarksIfNeeded() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setPreferredSize(animated: false) } @objc func appDidBecomeActive() { actionsTable.reloadData() } @IBAction func doneTapped(_ sender: UIButton) { ...
@@ -9,6 +9,9 @@ class ShelfActionsViewController: UIViewController, CheckTranscriptAvailability actionsTable.separatorColor = AppTheme.tableDividerColor(for: .dark) actionsTable.indicatorStyle = AppTheme.indicatorStyle() + + actionsTable.rowHeight = UITableView.automaticDimension ...
podcasts/ShelfActionsViewController.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Update player more options
3,993
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
addArchiveInactiveAction(time: -1, to: options) addArchiveInactiveAction(time: 24.hours, to: options) addArchiveInactiveAction(time: 2.days, to: options) addArchiveInactiveAction(time: 1.week, to: options) addArchiveInactiveAction(time: 2.weeks, to: options) ...
No issues found.
addArchiveInactiveAction(time: -1, to: options) addArchiveInactiveAction(time: 24.hours, to: options) addArchiveInactiveAction(time: 2.days, to: options) addArchiveInactiveAction(time: 1.week, to: options) addArchiveInactiveAction(time: 2.weeks, to: options) ...
@@ -101,6 +101,10 @@ extension PodcastArchiveViewController: UITableViewDataSource, UITableViewDelega // MARK: - Table Config func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + section == 0 ? CGFloat.leastNonzeroMagnitude : UITableView.automaticDimension + ...
podcasts/PodcastArchiveViewController+Table.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Podcast settings auto-archive and playback effects
3,999
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
filtersTable.isEditing = !filtersTable.isEditing filtersTable.reloadData() // this is needed to ensure the cell re-arrange controls are tinted correctly customRightBtn = UIBarButtonItem(barButtonSystemItem: filtersTable.isEditing ? .done : .edit, target: self, action: #selector(editTapped)) ...
No issues found.
filtersTable.isEditing = !filtersTable.isEditing filtersTable.reloadData() // this is needed to ensure the cell re-arrange controls are tinted correctly customRightBtn = UIBarButtonItem(barButtonSystemItem: filtersTable.isEditing ? .done : .edit, target: self, action: #selector(editTapped)) ...
@@ -72,7 +72,7 @@ class PlaylistsViewController: PCViewController, FilterCreatedDelegate { private var firstTimeLoading = true - lazy private var informationalBannerCoordinator: InformationalBannerViewCoordinator = { + lazy var informationalBannerCoordinator: InformationalBannerViewCoordinator = { ...
podcasts/PlaylistsViewController.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Account creation banner in section header to allow dynamic resize
4,001
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
actionDelegate.multiSelectActionCompleted() } } private class func markAsUnplayedEpisodes(actionDelegate: MultiSelectActionDelegate) { let selectedArchiveEpisodes = actionDelegate.multiSelectedBaseEpisodes().compactMap { $0 as? Episode } let selectedEpisodes = actionDelegate...
No issues found.
actionDelegate.multiSelectActionCompleted() } } private class func markAsUnplayedEpisodes(actionDelegate: MultiSelectActionDelegate) { let selectedArchiveEpisodes = actionDelegate.multiSelectedBaseEpisodes().compactMap { $0 as? Episode } let selectedEpisodes = actionDelegate...
@@ -42,6 +42,8 @@ class MultiSelectHelper { share(actionDelegate: actionDelegate, view: view) case .removeListeningHistory: removeListeningHistory(actionDelegate: actionDelegate) + case .addToPlaylist: + addToPlaylist(actionDelegate: actionDelegate) } }...
podcasts/MultiSelectHelper.swift
0
Swift
1
none
16
51
51
true
Add episodes to a playlist from multi-select overflow menu
4,002
Automattic/pocket-casts-ios
1,136
Swift
yaelirub
} } struct RoundedButton: ViewModifier { @EnvironmentObject var theme: Theme var destructive: Bool init(destructive: Bool = false) { self.destructive = destructive } func body(content: Content) -> some View { HStack { Spacer() content ....
No issues found.
} } struct RoundedButton: ViewModifier { @EnvironmentObject var theme: Theme var destructive: Bool init(destructive: Bool = false) { self.destructive = destructive } func body(content: Content) -> some View { HStack { Spacer() content ....
@@ -141,16 +141,18 @@ struct BasicButtonStyle: ButtonStyle { let textColor: Color let backgroundColor: Color let borderColor: Color? + let maxContentSizeCategory: UIContentSizeCategory - init(textColor: Color, backgroundColor: Color, borderColor: Color? = nil) { + init(textColor: Color, backgr...
podcasts/Styles.swift
0
Swift
1
none
16
51
51
true
[Dynamic Type] Login polish
4,006
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
/// Ignores play remote commands when other audio is playing case ignorePlayWithOtherAudio /// Read streaming data from memory buffer it's available case streamAndDownloadReadFromMemoryBuffer /// activates the audio session in the background to avoid locks in the main thread case activateAudi...
No issues found.
/// Ignores play remote commands when other audio is playing case ignorePlayWithOtherAudio /// Read streaming data from memory buffer it's available case streamAndDownloadReadFromMemoryBuffer /// activates the audio session in the background to avoid locks in the main thread case activateAudi...
@@ -239,9 +239,6 @@ public enum FeatureFlag: String, CaseIterable { /// Uses the PlaylistMetadataLoader cache before running the query (the query will update when it's done) case playlistDataCacheBeforeQuery - /// Avoid returning cached episode early and use policy instead - case episodesInfoCacheRelo...
Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift
0
Swift
1
none
16
51
51
true
Episode artwork network handling + prefer Show Notes image
4,017
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
banner.bottomAnchor.constraint(equalTo: wrapperView.bottomAnchor, constant: 0), ]) return wrapperView } // MARK: - App Backgrounding override func handleAppWillBecomeActive() { reloadEpisodes() addEventObservers() } override func handleAppDidEnterBa...
No issues found.
banner.bottomAnchor.constraint(equalTo: wrapperView.bottomAnchor, constant: 0), ]) return wrapperView } // MARK: - App Backgrounding override func handleAppWillBecomeActive() { reloadEpisodes() addEventObservers() } override func handleAppDidEnterBa...
@@ -11,7 +11,6 @@ class DownloadsViewController: PCViewController { refreshContentUnavailable() } } - var cellHeights: [IndexPath: CGFloat] = [:] private let episodesDataManager = EpisodesDataManager() @@ -26,8 +25,6 @@ class DownloadsViewController: PCViewController { di...
podcasts/DownloadsViewController.swift
0
Swift
1
none
16
51
51
true
[Dynamic type] Downloads header and banner
4,021
Automattic/pocket-casts-ios
1,136
Swift
SergioEstevao
/// Read streaming data from memory buffer it's available case streamAndDownloadReadFromMemoryBuffer /// activates the audio session in the background to avoid locks in the main thread case activateAudioSessionInBackground /// Use cellular-specific network APIs instead of expensive network APIs ...
No issues found.
/// Read streaming data from memory buffer it's available case streamAndDownloadReadFromMemoryBuffer /// activates the audio session in the background to avoid locks in the main thread case activateAudioSessionInBackground /// Use cellular-specific network APIs instead of expensive network APIs ...
@@ -292,6 +292,9 @@ public enum FeatureFlag: String, CaseIterable { /// Use transferUserInfo API for watch-to-phone actions and sendMessage for phone-to-watch state updates case watchTransferUserInfoApi + /// Remove the 50-episode limit when syncing Up Next to Apple Watch + case unlimitedWatchUpNextSy...
Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift
0
Swift
1
none
16
51
51
true
[Watch + Up Next] Remove Watch Up Next sync limit
4,028
Automattic/pocket-casts-ios
1,136
Swift
bjtitus
private class func markAsUnplayedEpisodes(actionDelegate: MultiSelectActionDelegate) { let selectedArchiveEpisodes = actionDelegate.multiSelectedBaseEpisodes().compactMap { $0 as? Episode } let selectedEpisodes = actionDelegate.multiSelectedBaseEpisodes() let status = selectedEpisodes.count ...
No issues found.
private class func markAsUnplayedEpisodes(actionDelegate: MultiSelectActionDelegate) { let selectedArchiveEpisodes = actionDelegate.multiSelectedBaseEpisodes().compactMap { $0 as? Episode } let selectedEpisodes = actionDelegate.multiSelectedBaseEpisodes() let status = selectedEpisodes.count ...
@@ -347,7 +347,16 @@ class MultiSelectHelper { } private class func addToPlaylist(actionDelegate: MultiSelectActionDelegate) { - let episodes = actionDelegate.multiSelectedBaseEpisodes().compactMap { $0 as? Episode } + let allSelected = actionDelegate.multiSelectedBaseEpisodes() + let e...
podcasts/MultiSelectHelper.swift
0
Swift
1
none
16
51
51
true
Add "Add to Playlist" option to Up Next multi-select menu
4,029
Automattic/pocket-casts-ios
1,136
Swift
yaelirub
propagate = true, defaultValue, lov, defaultLov = "", textAnchor = "bottom", width = "300px", updateVars = "", valueById, } = props; const [value, setValue] = useState<number|number[]>(0); const dispatch = useDispatch(); const delayCall = u...
The default value can be set in the expansion of props (L<55)
propagate = true, defaultValue, lov, defaultLov = "", textAnchor = "bottom", width = "300px", updateVars = "", valueById, step = 1, } = props; const [value, setValue] = useState<number|number[]>(0); const dispatch = useDispatch(); c...
@@ -68,6 +69,7 @@ const Slider = (props: SliderProps) => { const min = lovList.length ? 0 : props.min; const max = lovList.length ? lovList.length - 1 : props.max; + const step = props.step === undefined ? 1 : props.step;
frontend/taipy-gui/src/components/Taipy/Slider.tsx
26
TypeScript
0.214
suggestion
61
51
51
false
Added Step Property to the Slider component
800
Avaiga/taipy
12,680
Python
FredLL-Avaiga
Satoshi-Sh
* * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. *...
the property needs to be declared on the back end too See https://vscode.dev/github/Avaiga/taipy/blob/develop/taipy/gui/_renderers/factory.py#L428 Something like `("step", PropertyType.number, 1)` should do
* * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. *...
@@ -30,6 +30,7 @@ interface SliderProps extends LovProps<number | string | number[] | string[], nu height?: string; min?: number; max?: number; + step?: number;
frontend/taipy-gui/src/components/Taipy/Slider.tsx
26
TypeScript
0.786
suggestion
208
51
51
false
Added Step Property to the Slider component
800
Avaiga/taipy
12,680
Python
FredLL-Avaiga
Satoshi-Sh
if _is_data_node(entity_id): return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( ...
```suggestion sorted (Optional[bool]): If True, the returned list of scenarios is sorted by the sorting key. The default value is False. sort_key (Optional[Literal["name", "id", "creation_date", "tags"]]): The optional sort_key to decide upon what key scenarios are sorted. The de...
return _SequenceManagerFactory._build_manager()._hard_delete(SequenceId(entity_id)) if _is_task(entity_id): return _TaskManagerFactory._build_manager()._hard_delete(TaskId(entity_id)) if _is_data_node(entity_id): return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) ...
@@ -516,22 +521,37 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + sorted (Optional[bool]): The option ...
taipy/core/taipy.py
26
Python
0.786
suggestion
353
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, sorted: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "creation_date", "tags"]] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag. This function allows ...
I would not explain the sorting order here. If necessary, I think we can explain it right at the `sort_key` param description.
raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ) -> List[Scenario]: """Retrieve ...
@@ -516,22 +521,37 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + sorted (Optional[bool]): The option ...
taipy/core/taipy.py
26
Python
0.5
style
126
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build_filters_with_version("all") ...
What do you think about adding `descending` parameter with default value is False, and if True then we sort with reverse=True?
return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build_filters_with_version("all") ...
@@ -267,8 +267,16 @@ def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: return cls._get_all_by(filters) @classmethod - def _get_primary_scenarios(cls) -> List[Scenario]: - return [scenario for scenario in cls._get_all() if scenario.is_primary] + def _get_primary_scenarios( + ...
taipy/core/scenario/_scenario_manager.py
26
Python
0.5
question
127
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
@classmethod def _get_by_tag(cls, cycle: Cycle, tag: str) -> Optional[Scenario]: scenarios = cls._get_all_by_cycle(cycle) for scenario in scenarios: if scenario.has_tag(tag): return scenario return None @classmethod def _get_all_by_tag(cls, tag: str)...
Maybe, we can sort by `config_id` as well. It has some business meaning since it is populated by a user. So it makes sense to sort by `config_id` in case of multiple scenario configurations. We can also sort by label (which can be different from the name). What do you think?
@classmethod def _get_by_tag(cls, cycle: Cycle, tag: str) -> Optional[Scenario]: scenarios = cls._get_all_by_cycle(cycle) for scenario in scenarios: if scenario.has_tag(tag): return scenario return None @classmethod def _get_all_by_tag(cls, tag: str)...
@@ -267,8 +267,16 @@ def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: return cls._get_all_by(filters) @classmethod - def _get_primary_scenarios(cls) -> List[Scenario]: - return [scenario for scenario in cls._get_all() if scenario.is_primary] + def _get_primary_scenarios( + ...
taipy/core/scenario/_scenario_manager.py
26
Python
0.643
question
282
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
scenario_1_cfg = Config.configure_scenario(name="C_scenario", id="scenario_3", tags=["banana", "kiwi"]) scenario_2_cfg = Config.configure_scenario(name="B_scenario", id="scenario_1", tags=["apple", "banana"]) scenario_1 = _ScenarioManager._create(scenario_1_cfg) scenario_2 = _ScenarioManager._create(s...
A few remarks: 1. I believe it would be interesting to test what happens when some scenarios have the same value 2. I believe the following way of configuring and creating scenarios is more representative. - 2 scenario configs. - 1 scenario from the first config - 2 scenarios from the second config but attached t...
scenario_2_cfg = Config.configure_scenario(id="scenario_2", frequency=Frequency.DAILY) not_primary_scenario = _ScenarioManager._create(scenario_1_cfg, name="not_primary_scenario") now = datetime.now() scenario_1 = _ScenarioManager._create(scenario_1_cfg, now, "B_scenario") scenario_2 = _ScenarioMan...
@@ -813,6 +813,37 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + cycle_1 = _CycleManager._create(Frequency.DAILY, name="foo1") + cycle_2 = _CycleManager._create(Frequency.DAILY, name="foo2") + + scenario_1...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
question
1,955
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
with mock.patch("taipy.core.scenario._scenario_manager._ScenarioManager._hard_delete") as mck: scenario_id = ScenarioId("SCENARIO_id") tp.delete(scenario_id) mck.assert_called_once_with(scenario_id) def test_delete(self): with mock.patch("taipy.core.cycle._cycle_...
Usually, the name and the tags are specific to a scenario instance. They are not passed when building a scenario configuration, but they are provided as parameters during the scenario creation. You can have an example in my previous comment.
mck.assert_called_once_with(scenario_id) def test_delete(self): with mock.patch("taipy.core.cycle._cycle_manager._CycleManager._hard_delete") as mck: cycle_id = CycleId("CYCLE_id") tp.delete(cycle_id) mck.assert_called_once_with(cycle_id) def test_get_sc...
@@ -435,6 +435,28 @@ def test_get_scenarios(self, cycle): tp.get_scenarios(tag="tag") mck.assert_called_once_with("tag") + def test_get_scenarios_sorted(self): + scenario_1_cfg = Config.configure_scenario(name="B_scenario", id="scenario_3", tags=["banana", "kiwi"]) + scenari...
tests/core/test_taipy.py
26
Python
0.429
suggestion
246
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
""" scenario_manager = _ScenarioManagerFactory._build_manager() if not cycle and not tag: scenarios = scenario_manager._get_all() elif cycle and not tag: scenarios = scenario_manager._get_all_by_cycle(cycle) elif not cycle and tag: scenarios = scenario_manager._get_all_by_tag...
I suspect you wanted to use the following instead: ```suggestion if is_sorted: scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios ```
If is_sorted is set to true, the scenarios are sorted by sort_key. The scenarios are sorted by name if an incorrect or no sort_key is provided. """ scenario_manager = _ScenarioManagerFactory._build_manager() if not cycle and not tag: scenarios = scenario_manager._get_all() ...
@@ -516,22 +522,44 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (Optional[bool]): The opti...
taipy/core/taipy.py
26
Python
0.786
suggestion
190
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
scenarios.sort(key=lambda x: (tuple(sorted(x.tags)), x.id), reverse=descending) else: scenarios.sort(key=lambda x: (getattr(x, sort_key), x.id), reverse=descending) elif sort_key == "id": scenarios.sort(key=lambda x: x.id, reverse=descending) else:...
```suggestion is_sorted: Optional[bool] = False, descending: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "config_id", "creation_date", "tags"]] = "name", ```
scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns:...
@@ -547,13 +575,23 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + sorted: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "creation_date...
taipy/core/taipy.py
26
Python
0.714
suggestion
194
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: Optional[bool] = False, descending: Optional[bool] = False, s...
```suggestion what key scenarios are sorted. The sorting is in increasing order for dates, in alphabetical order for name and id, in lexographical order for tags. ```
if _is_data_node(entity_id): return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( ...
@@ -516,22 +522,44 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (Optional[bool]): The opti...
taipy/core/taipy.py
26
Python
0.714
suggestion
196
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
is_sorted: Optional[bool] = False, descending: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "config_id", "creation_date", "tags"]] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag. This function allows you to retrieve a list of sce...
```suggestion If no filtering criterion is provided, this method returns all existing scenarios. If is_sorted is set to true, the scenarios are sorted by sort_key. If an incorrect or no sort_key is provided, the scenarios are sorted by name. ```
def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag. ...
@@ -516,22 +522,44 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (Optional[bool]): The opti...
taipy/core/taipy.py
26
Python
0.786
bug
273
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scenario, this method returns None. """ return _ScenarioManagerFactory._build_manager()._get_primary(cycle) def get_primary_sce...
```suggestion scenario_manager = _ScenarioManagerFactory._build_manager() scenarios = scenario_manager._get_primary_scenarios() if is_sorted: scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios ```
def get_primary_scenarios( is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ) -> List[Scenario]: """Retrieve a list of all primary scenarios. Parameters: is_sorted (bool): The option to sort scenarios. The ...
@@ -547,13 +575,23 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + sorted: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "creation_date...
taipy/core/taipy.py
26
Python
0.786
suggestion
260
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
_CycleManager._set(cycle_1) _ScenarioManager._set(scenario_1) _ScenarioManager._set(scenario_2) assert len(_ScenarioManager._get_primary_scenarios()) == 0 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 _ScenarioManager._set_primary(scenario_1) assert len(_ScenarioManager._g...
Maybe we can create a scenario that won't be primary to test that the method works fine filtering out these not primary scenarios. ```suggestion not_primary_scenario = _ScenarioManager._create(scenario_1_cfg, name="not_primary_scenario") ```
_CycleManager._set(cycle_1) _ScenarioManager._set(scenario_1) _ScenarioManager._set(scenario_2) assert len(_ScenarioManager._get_primary_scenarios()) == 0 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 _ScenarioManager._set_primary(scenario_1) assert len(_ScenarioManager._...
@@ -813,6 +813,50 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
suggestion
246
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
def test_delete_scenario(self): with mock.patch("taipy.core.scenario._scenario_manager._ScenarioManager._hard_delete") as mck: scenario_id = ScenarioId("SCENARIO_id") tp.delete(scenario_id) mck.assert_called_once_with(scenario_id) def test_delete(self): with ...
```suggestion scenario_1_cfg = Config.configure_scenario(id="scenario_1") scenario_2_cfg = Config.configure_scenario(id="scenario_2") ```
tp.delete(scenario_id) mck.assert_called_once_with(scenario_id) def test_delete(self): with mock.patch("taipy.core.cycle._cycle_manager._CycleManager._hard_delete") as mck: cycle_id = CycleId("CYCLE_id") tp.delete(cycle_id) mck.assert_called_once_...
@@ -435,6 +435,45 @@ def test_get_scenarios(self, cycle): tp.get_scenarios(tag="tag") mck.assert_called_once_with("tag") + def test_get_scenarios_sorted(self): + scenario_1_cfg = Config.configure_scenario(id="scenario_3") + scenario_2_cfg = Config.configure_scenario(id="scen...
tests/core/test_taipy.py
26
Python
0.714
suggestion
156
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
tag: Optional[str] = None, is_sorted: Optional[bool] = False, descending: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "config_id", "creation_date", "tags"]] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag. This function allow...
```suggestion If no filtering criterion is provided, this method returns all existing scenarios. If is_sorted is set to true, the scenarios are sorted by sort_key. The scenarios are sorted by name if an incorrect or no sort_key is provided. ```
def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag....
@@ -516,22 +522,34 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (Optional[bool]): The opti...
taipy/core/taipy.py
26
Python
0.786
bug
284
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary sce...
```suggestion is_sorted (Optional[bool]): The option to sort scenarios. The default sorting key is name. descending (Optional[bool]): The option to sort scenarios on the sorting key in descending order. sort_key (Optional[Literal["name", "id", "creation_date", "tags"]]): The optiononal sor...
if is_sorted: scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scena...
@@ -547,13 +565,30 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: Optional[bool] = False, + descending: Optional[bool] = False, + sort_k...
taipy/core/taipy.py
26
Python
0.786
suggestion
523
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scenario, this method returns None. """ return _ScenarioManagerFactory._build_manager()._get_primary(cycle) def get_primary_sce...
```suggestion The sorting is in increasing order for dates, in alphabetical order for name and id, and in lexicographical order for tags. If sorted is set to true, but if an incorrect or no sort_key is provided, the scenarios are sorted by name. ```
"""Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scenario, this method returns None. """ return _Sc...
@@ -547,13 +565,30 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: Optional[bool] = False, + descending: Optional[bool] = False, + sort_k...
taipy/core/taipy.py
26
Python
0.786
bug
290
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
return scenario return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build...
`descending` should not be an optional. Just a bool. We have some linter rules preventing from merging that are failing because of that.
return scenario return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build...
@@ -270,6 +270,24 @@ def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: def _get_primary_scenarios(cls) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.is_primary] + @classmethod + def _sort_scenarios( + cls, + scenarios: List[Scenario], + ...
taipy/core/scenario/_scenario_manager.py
26
Python
0.571
bug
136
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build_filters_with_version("all") ...
```suggestion sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ``` `sort_key` doesn't accept `None` as a possible value, so it should not be an `Optional` type.
return None @classmethod def _get_all_by_tag(cls, tag: str) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.has_tag(tag)] @classmethod def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: filters = cls._build_filters_with_version("all") ...
@@ -270,6 +270,24 @@ def _get_all_by_cycle(cls, cycle: Cycle) -> List[Scenario]: def _get_primary_scenarios(cls) -> List[Scenario]: return [scenario for scenario in cls._get_all() if scenario.is_primary] + @classmethod + def _sort_scenarios( + cls, + scenarios: List[Scenario], + ...
taipy/core/scenario/_scenario_manager.py
26
Python
1
suggestion
202
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
ModelNotFound: No entity corresponds to the specified *entity_id*. """ if _is_job(entity_id): job_manager = _JobManagerFactory._build_manager() return job_manager._delete(job_manager._get(JobId(entity_id))) if _is_cycle(entity_id): return _CycleManagerFactory._build_manager()...
```suggestion is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ``` `is_sorted`, `descending`, and `sort_key` don't accept `None` as a possible value, so they should not have the `Optional` type.
The identifier of the entity to delete. Raises: ModelNotFound: No entity corresponds to the specified *entity_id*. """ if _is_job(entity_id): job_manager = _JobManagerFactory._build_manager() return job_manager._delete(job_manager._get(JobId(entity_id))) if _is_cycle...
@@ -505,7 +505,13 @@ def delete(entity_id: Union[TaskId, DataNodeId, SequenceId, ScenarioId, JobId, C raise ModelNotFound("NOT_DETERMINED", entity_id) -def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> List[Scenario]: +def get_scenarios( + cycle: Optional[Cycle] = None, + tag...
taipy/core/taipy.py
26
Python
1
suggestion
293
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None...
```suggestion is_sorted (bool): The option to sort scenarios. The default sorting key is name. descending (bool): The option to sort scenarios on the sorting key in descending order. sort_key (Literal["name", "id", "creation_date", "tags"]): The optiononal sort_key to decide upon ```
if _is_task(entity_id): return _TaskManagerFactory._build_manager()._hard_delete(TaskId(entity_id)) if _is_data_node(entity_id): return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()....
@@ -516,22 +522,34 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (Optional[bool]): The opti...
taipy/core/taipy.py
26
Python
0.786
suggestion
315
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
scenarios = [scenario for scenario in cycles_scenarios if scenario.has_tag(tag)] else: scenarios = [] if is_sorted: scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary s...
```suggestion is_sorted: bool = False, descending: bool = False, sort_key: Literal["name", "id", "config_id", "creation_date", "tags"] = "name", ```
scenarios = scenario_manager._get_all_by_tag(tag) elif cycle and tag: cycles_scenarios = scenario_manager._get_all_by_cycle(cycle) scenarios = [scenario for scenario in cycles_scenarios if scenario.has_tag(tag)] else: scenarios = [] if is_sorted: scenario_manager._so...
@@ -547,13 +565,32 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: Optional[bool] = False, + descending: Optional[bool] = False, + sort_k...
taipy/core/taipy.py
26
Python
0.714
suggestion
164
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary sce...
```suggestion is_sorted (bool): The option to sort scenarios. The default sorting key is name. descending (bool): The option to sort scenarios on the sorting key in descending order. sort_key (Literal["name", "id", "creation_date", "tags"]): The optiononal sort_key to decide upon ```
if is_sorted: scenario_manager._sort_scenarios(scenarios, descending, sort_key) return scenarios def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scena...
@@ -547,13 +565,32 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: Optional[bool] = False, + descending: Optional[bool] = False, + sort_k...
taipy/core/taipy.py
26
Python
0.786
suggestion
315
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
trgiangdo
Luke-0162
return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: bool = False, descending: bool = False, sort_key: Literal["na...
W291 Trailing whitespace ```suggestion sort_key (Literal["name", "id", "creation_date", "tags"]): The optiononal sort_key to decide upon what key scenarios are sorted. The sorting is in increasing order for dates, in alphabetical order for name and id, in lexographical order for...
if _is_data_node(entity_id): return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( ...
@@ -516,22 +522,34 @@ def get_scenarios(cycle: Optional[Cycle] = None, tag: Optional[str] = None) -> L Parameters: cycle (Optional[Cycle^]): The optional `Cycle^` to filter scenarios by. tag (Optional[str]): The optional tag to filter scenarios by. + is_sorted (bool): The option to sort...
taipy/core/taipy.py
26
Python
0.786
suggestion
331
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scena...
W291 Trailing whitespace ```suggestion sort_key (Literal["name", "id", "creation_date", "tags"]): The optiononal sort_key to decide upon what key scenarios are sorted. The sorting is in increasing order for dates, in alphabetical order for name and id, in lexographical order for t...
return scenarios def get_primary(cycle: Cycle) -> Optional[Scenario]: """Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no ...
@@ -547,13 +565,32 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: bool = False, + descending: bool = False, + sort_key: Literal["name", ...
taipy/core/taipy.py
26
Python
0.786
suggestion
329
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scenario, this method returns None. """ return _ScenarioManagerFactory._build_manager()._get_primary(cycle) def get_primary_sce...
W291 Trailing whitespace ```suggestion The sorting is in increasing order for dates, in alphabetical order for name and ```
"""Retrieve the primary scenario associated with a cycle. Parameters: cycle (Cycle^): The cycle for which to retrieve the primary scenario. Returns: The primary scenario of the given _cycle_. If the cycle has no primary scenario, this method returns None. """ return _Sc...
@@ -547,13 +565,32 @@ def get_primary(cycle: Cycle) -> Optional[Scenario]: return _ScenarioManagerFactory._build_manager()._get_primary(cycle) -def get_primary_scenarios() -> List[Scenario]: +def get_primary_scenarios( + is_sorted: bool = False, + descending: bool = False, + sort_key: Literal["name", ...
taipy/core/taipy.py
26
Python
0.714
suggestion
138
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
assert len(_ScenarioManager._get_primary_scenarios()) == 0 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 _ScenarioManager._set_primary(scenario_1) assert len(_ScenarioManager._get_primary_scenarios()) == 1 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 assert _Sce...
E501 Line too long ```suggestion scenario_2 = _ScenarioManager._create(scenario_2_cfg, name="A_scenario", creation_date=datetime.now() + timedelta(days=2)) scenario_3 = _ScenarioManager._create(scenario_2_cfg, ...
assert len(_ScenarioManager._get_primary_scenarios()) == 0 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 _ScenarioManager._set_primary(scenario_1) assert len(_ScenarioManager._get_primary_scenarios()) == 1 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 assert _Sce...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
refactor
683
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
def test_get_primary_scenarios_sorted(): scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) scenario_2_cfg = Config.configure_scenario(id="scenario_2", frequency=Frequency.DAILY) not_primary_scenario = _ScenarioManager._create(scenario_1_cfg, name="not_primary_scenario")...
E501 Line too long ```suggestion assert primary_scenarios_sorted_by_name == _ScenarioManager._sort_scenarios(primary_scenarios, descending=False, sort_key="name") ```
def test_get_primary_scenarios_sorted(): scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) scenario_2_cfg = Config.configure_scenario(id="scenario_2", frequency=Frequency.DAILY) not_primary_scenario = _ScenarioManager._create(scenario_1_cfg, name="not_primary_scenario")...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
refactor
245
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
scenario_1 = _ScenarioManager._create(scenario_1_cfg, name="B_scenario") scenario_2 = _ScenarioManager._create(scenario_2_cfg, name="A_scenario", creation_date=datetime.now() + timedelta(days=2)) scenario_3 = _ScenarioManager._create(scenario_2_cfg, name="C_scenario", creation_date=datetime.now() + timedelt...
E501 Line too long ```suggestion primary_scenarios_sorted_by_config_id = [scenario_1, scenarios_with_same_config_id[0], scenarios_with_same_config_id[1], scenarios_with_same_...
now = datetime.now() scenario_1 = _ScenarioManager._create(scenario_1_cfg, now, "B_scenario") scenario_2 = _ScenarioManager._create(scenario_2_cfg, now + timedelta(days=2), "A_scenario") scenario_3 = _ScenarioManager._create(scenario_2_cfg, now + timedelta(days=4), "C_scenario") scenario_4 = _Scenar...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
refactor
551
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
_ScenarioManager._set_primary(scenario_1) scenario_1.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_2) scenario_2.tags = ["apple", "banana"] _ScenarioManager._set_primary(scenario_3) scenario_3.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_4) all_sc...
E501 Line too long ```suggestion assert scenarios_sorted_by_id == _ScenarioManager._sort_scenarios(primary_scenarios, descending=False, sort_key="id") ```
scenario_4 = _ScenarioManager._create(scenario_2_cfg, now + timedelta(days=3), "D_scenario") _ScenarioManager._set_primary(scenario_1) scenario_1.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_2) scenario_2.tags = ["apple", "banana"] _ScenarioManager._set_primary(scenario_3) ...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
refactor
305
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
_ScenarioManager._set_primary(scenario_2) scenario_2.tags = ["apple", "banana"] _ScenarioManager._set_primary(scenario_3) scenario_3.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_4) all_scenarios = tp.get_scenarios() assert not_primary_scenario in all_scenarios prima...
```suggestion assert primary_scenarios_sorted_by_creation_date == _ScenarioManager._sort_scenarios(primary_scenarios, descending=False, ```
scenario_1.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_2) scenario_2.tags = ["apple", "banana"] _ScenarioManager._set_primary(scenario_3) scenario_3.tags = ["banana", "kiwi"] _ScenarioManager._set_primary(scenario_4) all_scenarios = tp.get_scenarios() assert not_pri...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.714
suggestion
180
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
all_scenarios = tp.get_scenarios() assert not_primary_scenario in all_scenarios primary_scenarios = _ScenarioManager._get_primary_scenarios() assert not_primary_scenario not in primary_scenarios primary_scenarios_sorted_by_name = [scenario_2, scenario_1, scenario_3, scenario_4] assert primary_...
E501 Line too long ```suggestion primary_scenarios_sorted_by_tags = [scenario_4, scenario_2, scenarios_with_same_tags[0], scenarios_with_same_tags[1]] assert primary_scenarios_sorted_by_tags == _ScenarioManager._sort_scenario...
all_scenarios = tp.get_scenarios() assert not_primary_scenario in all_scenarios primary_scenarios = _ScenarioManager._get_primary_scenarios() assert not_primary_scenario not in primary_scenarios primary_scenarios_sorted_by_name = [scenario_2, scenario_1, scenario_3, scenario_4] assert primary...
@@ -813,6 +814,57 @@ def test_get_set_primary_scenario(): assert _ScenarioManager._get_primary(cycle_1) == scenario_2 +def test_get_primary_scenarios_sorted(): + scenario_1_cfg = Config.configure_scenario(id="scenario_1", frequency=Frequency.DAILY) + scenario_2_cfg = Config.configure_scenario(id="scenari...
tests/core/scenario/test_scenario_manager.py
26
Python
0.786
refactor
448
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
tp.get_scenarios(tag="tag") mck.assert_called_once_with("tag") def test_get_scenarios_sorted(self): scenario_1_cfg = Config.configure_scenario(id="scenario_1") scenario_2_cfg = Config.configure_scenario(id="scenario_2") scenario_1 = _ScenarioManager._create(scenario...
E501 Line too long ```suggestion scenarios_sorted_by_config_id = [scenario_1, scenarios_with_same_config_id[0], scenarios_with_same_config_id[1], scenarios_with_same_config_id[2]] `...
def test_get_scenarios_sorted(self): scenario_1_cfg = Config.configure_scenario(id="scenario_1") scenario_2_cfg = Config.configure_scenario(id="scenario_2") now = datetime.datetime.now() + datetime.timedelta(seconds=1) scenario_1 = _ScenarioManager._create(scenario_1_cfg, now, "B_sc...
@@ -435,6 +435,46 @@ def test_get_scenarios(self, cycle): tp.get_scenarios(tag="tag") mck.assert_called_once_with("tag") + def test_get_scenarios_sorted(self): + scenario_1_cfg = Config.configure_scenario(id="scenario_1") + scenario_2_cfg = Config.configure_scenario(id="scen...
tests/core/test_taipy.py
26
Python
0.786
refactor
322
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
scenario_4 = _ScenarioManager._create(scenario_2_cfg, name="D_scenario") _ScenarioManager._tag(scenario_1, "banana") _ScenarioManager._tag(scenario_1, "kiwi") # scenario_1 now has tags {"banana", "kiwi"} _ScenarioManager._tag(scenario_2, "apple") _ScenarioManager._tag(scenari...
E501 Line too long ```suggestion # Note: the scenario without any tags comes first. scenarios_sorted_by_tag = [scenario_4, scenario_2, scenario_3, scenario_1] ```
_ScenarioManager._tag(scenario_1, "banana") _ScenarioManager._tag(scenario_1, "kiwi") # scenario_1 now has tags {"banana", "kiwi"} _ScenarioManager._tag(scenario_2, "apple") _ScenarioManager._tag(scenario_2, "banana") # scenario_2 now has tags {"banana", "apple"} _ScenarioManag...
@@ -435,6 +435,46 @@ def test_get_scenarios(self, cycle): tp.get_scenarios(tag="tag") mck.assert_called_once_with("tag") + def test_get_scenarios_sorted(self): + scenario_1_cfg = Config.configure_scenario(id="scenario_1") + scenario_2_cfg = Config.configure_scenario(id="scen...
tests/core/test_taipy.py
26
Python
0.714
refactor
185
51
51
false
Feature/#392 - Sort mechanism for `get_primary_scenarios()` and `get_scenarios()` API
1,042
Avaiga/taipy
12,680
Python
jrobinAV
Luke-0162
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
```suggestion from typing import TYPE_CHECKING, Set if TYPE_CHECKING: from taipy import CycleId, DataNodeId, JobId, ScenarioId, SequenceId, SubmissionId, TaskId ``` I would do this to avoid the local import
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
@@ -11,16 +11,20 @@ from __future__ import annotations +from typing import Set
taipy/core/_entity/_entity_ids.py
14
Python
1
suggestion
219
39
39
false
Removing useless type annotation
1,193
Avaiga/taipy
12,680
Python
trgiangdo
jrobinAV
"""Indicate if this data node is valid. Returns: False if the data ever been written or the expiration date has passed.<br/> True otherwise. """ if not self._last_edit_date: # Never been written so it is not valid return False if n...
We have a wrong indentation here. ```suggestion Returns: False if a preceding data node has been updated before the selected data node or the selected data is invalid.<br/> True otherwise. """ ```
return False if not self._last_edit_date: # Never been written so it is not up-to-date return False return True @property # type: ignore @_self_reload(_MANAGER_NAME) def is_valid(self) -> bool: """Indicate if this data node is valid. Ret...
@@ -505,25 +505,27 @@ def is_valid(self) -> bool: def is_up_to_date(self) -> bool: """Indicate if this data node is up-to-date. - Returns: - False if a preceding data node has been updated before the selected data node - or the selected data is invalid.<br/> - Tru...
taipy/core/data/data_node.py
26
Python
0.786
bug
255
51
51
false
<DataNode>.is_up_to_date raises error when never written before
1,224
Avaiga/taipy
12,680
Python
jrobinAV
yaten2302
return True @property def is_up_to_date(self) -> bool: """Indicate if this data node is up-to-date. Returns: False if a preceding data node has been updated before the selected data node or the selected data is invalid.<br/> True otherwise. "...
The logic of this block will always return `False`. It should be like: ```suggestion if self.is_valid: from ..scenario.scenario import Scenario from ..taipy import get_parents parent_scenarios: Set[Scenario] = get_parents(self)["scenario"] # type: ignore ...
if not self._last_edit_date: # Never been written so it is not valid return False if not self._validity_period: # No validity period and has already been written, so it is valid return True if datetime.now() > self.expiration_date: # ex...
@@ -511,19 +511,21 @@ def is_up_to_date(self) -> bool: True otherwise. """ - from ..scenario.scenario import Scenario - from ..taipy import get_parents - - parent_scenarios: Set[Scenario] = get_parents(self)["scenario"] # type: ignore - for parent_scenario in parent_...
taipy/core/data/data_node.py
26
Python
1
suggestion
792
51
51
false
<DataNode>.is_up_to_date raises error when never written before
1,224
Avaiga/taipy
12,680
Python
trgiangdo
yaten2302
_COMMAND_NAME = "create" _ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( ...
Can't we simply get rid of the cookie-cutter exception? Plus I believe we don't need to use the taipy logger here. There is no application running. We just exit the command line with a message.
_COMMAND_NAME = "create" _ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( ...
@@ -45,6 +46,10 @@ def handle_command(cls): args = cls._parse_arguments() if not args: return - - cookiecutter(cls._TEMPLATE_MAP[args.template]) + try: + cookiecutter(cls._TEMPLATE_MAP[args.template]) + except OutputDirExistsException as err: + e...
taipy/_cli/_scaffold_cli.py
26
Python
0.571
suggestion
196
29
29
false
Fix/#1202 - Catch cookiecutter.OutputDirExistsException and exit
1,228
Avaiga/taipy
12,680
Python
jrobinAV
trgiangdo
_ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( "--template", ...
```suggestion sys.exit(1) ```
_ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( "--template", ...
@@ -45,6 +46,10 @@ def handle_command(cls): args = cls._parse_arguments() if not args: return - - cookiecutter(cls._TEMPLATE_MAP[args.template]) + try: + cookiecutter(cls._TEMPLATE_MAP[args.template]) + except OutputDirExistsException as err: + er...
taipy/_cli/_scaffold_cli.py
26
Python
0.429
suggestion
42
28
28
false
Fix/#1202 - Catch cookiecutter.OutputDirExistsException and exit
1,228
Avaiga/taipy
12,680
Python
jrobinAV
trgiangdo
_ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( "--template", ...
```suggestion error_msg = f"{str(err)}. Please remove the existing directory or provide a new folder name." print(error_msg) sys.exit(1) ```
_ARGUMENTS = ["--template"] @classmethod def create_parser(cls): create_parser = _TaipyParser._add_subparser( cls._COMMAND_NAME, help="Create a new Taipy application using pre-defined templates.", ) create_parser.add_argument( "--template", ...
@@ -45,6 +46,10 @@ def handle_command(cls): args = cls._parse_arguments() if not args: return - - cookiecutter(cls._TEMPLATE_MAP[args.template]) + try: + cookiecutter(cls._TEMPLATE_MAP[args.template]) + except OutputDirExistsException as err: + er...
taipy/_cli/_scaffold_cli.py
26
Python
0.929
suggestion
180
28
28
false
Fix/#1202 - Catch cookiecutter.OutputDirExistsException and exit
1,228
Avaiga/taipy
12,680
Python
jrobinAV
trgiangdo
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
this is for the gui guys 😄 @FabienLelaquais ?
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
tests/gui/utils/test_types.py
1
Python
0.071
question
50
26
26
false
Fix/doc#913 - Update refman on get_scenarios methods
1,259
Avaiga/taipy
12,680
Python
jrobinAV
trgiangdo
Returns: The set of output data nodes. """ dag = self._build_dag() return self.__get_outputs(dag) def __get_outputs(self, dag: nx.DiGraph) -> set[DataNode]: return {node for node, degree in dict(dag.out_degree).items() if degree == 0 and isinstance(node, DataNod...
Just want to make it clearer ```suggestion A Reason object that can function as a Boolean value, which is True if the given entity is ready to be run or there is no reason to be blocked, False otherwise. ```
Returns: The set of output data nodes. """ dag = self._build_dag() return self.__get_outputs(dag) def __get_outputs(self, dag: nx.DiGraph) -> set[DataNode]: return {node for node, degree in dict(dag.out_degree).items() if degree == 0 and isinstance(node, DataNod...
@@ -81,13 +82,22 @@ def get_intermediate(self) -> Set[DataNode]: all_data_nodes_in_dag = {node for node in dag.nodes if isinstance(node, DataNode)} return all_data_nodes_in_dag - self.__get_inputs(dag) - self.__get_outputs(dag) - def is_ready_to_run(self) -> bool: + def is_ready_to_run(self) -...
taipy/core/_entity/submittable.py
26
Python
0.786
suggestion
235
51
51
false
feature/#746 added reason class
1,276
Avaiga/taipy
12,680
Python
trgiangdo
toan-quach
else: if publish: self._in_context_attributes_changed_collector.append(event) return _do_set_entity return __set_entity @functools.lru_cache def _get_manager(manager: str) -> _Manager: from ..cycle._cycle_manager_factory import _CycleManagerFactory ...
WHy do we need to add a "# type: ignore" here?
self._in_context_attributes_changed_collector.append(event) return _do_set_entity return __set_entity @functools.lru_cache def _get_manager(manager: str) -> _Manager: from ..cycle._cycle_manager_factory import _CycleManagerFactory from ..data._data_manager_factory import _DataMan...
@@ -104,6 +106,4 @@ def _get_manager(manager: str) -> _Manager: "job": _JobManagerFactory._build_manager(), "task": _TaskManagerFactory._build_manager(), "submission": _SubmissionManagerFactory._build_manager(), - }[ - manager - ] # type: ignore + }[manager] # type: ignore
taipy/core/_entity/_reload.py
26
Python
0.214
question
46
29
27
false
feature/#1197 pass job as metadata for event
1,277
Avaiga/taipy
12,680
Python
jrobinAV
toan-quach
new_status = submission.submission_status client_id = submission.properties.get("client_id") if client_id: running_tasks = {} with self.gui._get_autorization(client_id): for job in submission.jobs: job = job...
`core_get(submission.entity_id)` is a scenario. I guess we want to pass the submission instead: `core_get(submission.id)`. @FredLL-Avaiga @toan-quach What do you think?
new_status = submission.submission_status client_id = submission.properties.get("client_id") if client_id: running_tasks = {} with self.gui._get_autorization(client_id): for job in submission.jobs: job = job...
@@ -174,7 +174,10 @@ def submission_status_callback(self, submission_id: t.Optional[str]): self.gui._call_user_callback( client_id, submission_name, - [core_get(submission.entity_id), {"submissi...
taipy/gui_core/_context.py
26
Python
0.571
question
173
51
51
false
feature/#1197 pass job as metadata for event
1,277
Avaiga/taipy
12,680
Python
jrobinAV
toan-quach
running_tasks = {} with self.gui._get_autorization(client_id): for job in submission.jobs: job = job if isinstance(job, Job) else core_get(job) running_tasks[job.task.id] = ( SubmissionStatus....
any possibility that event.metadata holds the other 2 keys ? why not put it first and then override with the other 2 keys ?
running_tasks = {} with self.gui._get_autorization(client_id): for job in submission.jobs: job = job if isinstance(job, Job) else core_get(job) running_tasks[job.task.id] = ( SubmissionStatus....
@@ -174,7 +174,14 @@ def submission_status_callback(self, submission_id: t.Optional[str]): self.gui._call_user_callback( client_id, submission_name, - [core_get(submission.entity_id), {"submissi...
taipy/gui_core/_context.py
26
Python
0.357
question
124
51
51
false
feature/#1197 pass job as metadata for event
1,277
Avaiga/taipy
12,680
Python
FredLL-Avaiga
toan-quach
background: `linear-gradient(${ horizontalOrientation ? 90 : 0 }deg, rgba(255,0,0,1) 0%, rgba(0,255,0,1) 100%)`, opacity: "unset", }, "& .MuiSlider-track": { border: "none", ...
I think a span would have less impact of the display ?
}deg, rgba(255,0,0,1) 0%, rgba(0,255,0,1) 100%)`, opacity: "unset", }, "& .MuiSlider-track": { border: "none", backgroundColor: "transparent", }, "& .MuiSlider-valueLabel": { ...
@@ -96,19 +96,21 @@ const Indicator = (props: IndicatorProps) => { return ( <Tooltip title={hover || ""}> - <Slider - id={props.id} - className={className} - min={0} - max={100} - value={getValue(value === undefined ? ...
frontend/taipy-gui/src/components/Taipy/Indicator.tsx
26
TypeScript
0.214
question
54
46
40
false
Remove hover_text from Indicator
1,282
Avaiga/taipy
12,680
Python
FredLL-Avaiga
Satoshi-Sh
SQL Data Node, CSV Data Node, ...). !!! note It is not recommended to instantiate subclasses of `DataNode` directly. Instead, you have two ways: 1. Create a Scenario using the `create_scenario()^` function. Related data nodes will be created automatically. Please refer to t...
```suggestion # Retrieve the list of all data nodes ```
_ReadyToRunProperty._add(dn, f"DataNode {dn.id} is being edited") else: _ReadyToRunProperty._remove(dn, f"DataNode {dn.id} is being edited") if not dn._last_edit_date: _ReadyToRunProperty._add(dn, f"DataNode {dn.id} is not written") else: _ReadyToR...
@@ -46,7 +46,37 @@ class DataNode(_Entity, _Labeled): SQL Data Node, CSV Data Node, ...). !!! note - It is recommended not to instantiate subclasses of `DataNode` directly. + It is not recommended to instantiate subclasses of `DataNode` directly. Instead, + you have two ways: + + ...
taipy/core/data/data_node.py
26
Python
0.571
suggestion
65
51
51
false
Feature/#709 user man
1,285
Avaiga/taipy
12,680
Python
trgiangdo
jrobinAV
# Retrieve all data nodes all_data_nodes = tp.get_data_nodes() # Write the data dataset.write("Hello, World!") # Read the data print(dataset.read()) ``` Attributes: config_id (str): Identifier of the data node configuration. It must be a valid Pytho...
```suggestion - timestamp: The time instant of the writing - comments: Representation of a free text to explain or comment on a data change - job_id: Only populated when the data node is written by a task execution and corresponds to the job's id...
1. Create a Scenario using the `create_scenario()^` function. Related data nodes will be created automatically. Please refer to the `Scenario^` class for more information. 2. Configure a `DataNodeConfig^` with the various configuration methods form `Config^` and use t...
@@ -60,9 +90,10 @@ class DataNode(_Entity, _Labeled): last_edit_date (datetime): The date and time of the last modification. edits (List[Edit^]): The list of Edits (an alias for dict) containing metadata about each data edition including but not limited to timestamp, comments, job_id: - ...
taipy/core/data/data_node.py
26
Python
0.857
suggestion
478
51
51
false
Feature/#709 user man
1,285
Avaiga/taipy
12,680
Python
trgiangdo
jrobinAV
InvalidSequence, NonExistingDataNode, NonExistingSequence, NonExistingTask, SequenceAlreadyExists, SequenceTaskDoesNotExistInScenario, ) from ..job.job import Job from ..notification import Event, EventEntityType, EventOperation, Notifier, _make_event from ..sequence.sequence import Sequence fro...
Add identation ```suggestion It is not recommended to instantiate a `Scenario` directly. Instead, it should be created with the `create_scenario()^` function. ```
InvalidSequence, NonExistingDataNode, NonExistingSequence, NonExistingTask, SequenceAlreadyExists, SequenceTaskDoesNotExistInScenario, ) from ..job.job import Job from ..notification import Event, EventEntityType, EventOperation, Notifier, _make_event from ..sequence.sequence import Sequence fro...
@@ -55,6 +55,39 @@ class Scenario(_Entity, Submittable, _Labeled): solve the Business case. It also holds a set of additional data nodes (instances of `DataNode` class) for extra data related to the scenario. + !!! note + It is not recommended to instantiate a `Scenario` directly. Instead, it should b...
taipy/core/scenario/scenario.py
26
Python
0.786
suggestion
186
51
51
false
Feature/#709 user man
1,285
Avaiga/taipy
12,680
Python
trgiangdo
jrobinAV
def by_two(x: int): return x * 2 # Configure data nodes, tasks and scenarios input_cfg = Config.configure_data_node("my_input", default_data=2) result_cfg = Config.configure_data_node("my_result") task_cfg = Config.configure_task("my_double", function=by_two, input=...
```suggestion # Retrieve the list of all tasks ```
def by_two(x: int): return x * 2 # Configure data nodes, tasks and scenarios input_cfg = Config.configure_data_node("my_input", default_data=2) result_cfg = Config.configure_data_node("my_result") task_cfg = Config.configure_task("my_double", function=by_two, input=...
@@ -33,6 +33,46 @@ class Task(_Entity, _Labeled): A `Task` brings together the user code as function, the inputs and the outputs as data nodes (instances of the `DataNode^` class). + !!! note + It is not recommended to instantiate a `Task` directly. Instead, it should be + created with the ...
taipy/core/task/task.py
26
Python
0.571
suggestion
60
51
51
false
Feature/#709 user man
1,285
Avaiga/taipy
12,680
Python
trgiangdo
jrobinAV
last_edit_date (datetime): The date and time of the last modification. edits (List[Edit^]): The list of Edits (an alias for dict) containing metadata about each data edition including but not limited to: <ul><li>timestamp: The time instant of the writing </li> ...
@trgiangdo This is what I found to make it work.
# Retrieve the list of all data nodes all_data_nodes = tp.get_data_nodes() # Write the data dataset.write("Hello, World!") # Read the data print(dataset.read()) ``` Attributes: config_id (str): Identifier of the data node configuration. It must be a...
@@ -59,10 +89,11 @@ class DataNode(_Entity, _Labeled): parent_ids (Optional[Set[str]]): The set of identifiers of the parent tasks. last_edit_date (datetime): The date and time of the last modification. edits (List[Edit^]): The list of Edits (an alias for dict) containing metadata about each ...
taipy/core/data/data_node.py
26
Python
0.071
suggestion
48
51
51
false
Feature/#709 user man
1,285
Avaiga/taipy
12,680
Python
jrobinAV
jrobinAV
"tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, var_type=PropertyType.lov_value) .set_attributes( [ ...
I suppose `Progress` is more generic than `ProgressBar` (especially when we want to support circular progress)
] ) ._set_kind() ._set_propagate(), "tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, v...
@@ -597,6 +597,19 @@ class _Factory: ] ) ._set_propagate(), + "ProgressBar": lambda gui, control_type, attrs: _Builder(
taipy/gui/_renderers/factory.py
26
Python
0.5
suggestion
110
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
"tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, var_type=PropertyType.lov_value) .set_attributes( [ ...
you also need to declare the component and it's default property at the top of the file I propose `value` and then add a call to `.set_value_and_default(var_type=PropertyType.dynamic_number)`
] ) ._set_kind() ._set_propagate(), "tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, v...
@@ -597,6 +597,19 @@ class _Factory: ] ) ._set_propagate(), + "ProgressBar": lambda gui, control_type, attrs: _Builder(
taipy/gui/_renderers/factory.py
26
Python
0.643
suggestion
193
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
("expanded", PropertyType.boolean_or_list, True), ("filter", PropertyType.boolean), ("hover_text", PropertyType.dynamic_string), ("height", PropertyType.string_or_number), ("id",), ("value_by_id", PropertyType.boolean), ...
property names have to be aligned (and in a pythonic way) `showProgress `=> `show_value`
.set_attributes( [ ("active", PropertyType.dynamic_boolean, True), ("expanded", PropertyType.boolean_or_list, True), ("filter", PropertyType.boolean), ("hover_text", PropertyType.dynamic_string), ("height", PropertyType....
@@ -597,6 +598,20 @@ class _Factory: ] ) ._set_propagate(), + "Progress": lambda gui, control_type, attrs: _Builder( + gui=gui, + control_type=control_type, + element_name="Progress", + attributes=attrs, + ) + .set_value_and...
taipy/gui/_renderers/factory.py
26
Python
0.357
suggestion
89
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
.set_value_and_default(with_default=False, var_type=PropertyType.lov_value) .set_attributes( [ ("active", PropertyType.dynamic_boolean, True), ("expanded", PropertyType.boolean_or_list, True), ("filter", PropertyType.boolean), (...
why specify `with_default=False` ?
element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, var_type=PropertyType.lov_value) .set_attributes( [ ("active", PropertyType.dynamic_boolean, True), ("expanded", PropertyType.boolean_or_lis...
@@ -597,6 +598,20 @@ class _Factory: ] ) ._set_propagate(), + "Progress": lambda gui, control_type, attrs: _Builder( + gui=gui, + control_type=control_type, + element_name="Progress", + attributes=attrs, + ) + .set_value_and...
taipy/gui/_renderers/factory.py
26
Python
0.214
question
34
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
Chart: Chart, DateRange: DateRange, DateSelector: DateSelector, Dialog: Dialog, Expandable: Expandable, Field: Field, FileDownload: FileDownload, FileSelector: FileSelector, Image: Image, Indicator: I...
Can you change this for Progress: Progress ? The key is used by JsxParser to find the component => it has to be the same has what is declared in factory.py
Chart: Chart, DateRange: DateRange, DateSelector: DateSelector, Dialog: Dialog, Expandable: Expandable, Field: Field, FileDownload: FileDownload, FileSelector: FileSelector, Image: Image, Indicator: I...
@@ -74,6 +75,7 @@ export const getRegisteredComponents = () => { Table: Table, Toggle: Toggle, TreeView: TreeView, + ProgressBar: Progress,
frontend/taipy-gui/src/components/Taipy/index.ts
26
TypeScript
0.429
suggestion
155
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
/* * Copyright 2021-2024 Avaiga Private Limited * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
you can get the getByRole and getBy* functionc from the render like it's done in the other tests const { getByRole } = render(...)
/* * Copyright 2021-2024 Avaiga Private Limited * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
@@ -0,0 +1,46 @@ +/* + * Copyright 2021-2024 Avaiga Private Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unles...
frontend/taipy-gui/src/components/Taipy/Progress.spec.tsx
23
TypeScript
0.357
suggestion
131
47
47
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
"tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, var_type=PropertyType.lov_value) .set_attributes( [ ...
this should be `progress` and not `Progress`
) ._set_kind() ._set_propagate(), "tree": lambda gui, control_type, attrs: _Builder( gui=gui, control_type=control_type, element_name="TreeView", attributes=attrs, ) .set_value_and_default(with_default=False, var_type=Proper...
@@ -597,6 +598,20 @@ class _Factory: ] ) ._set_propagate(), + "Progress": lambda gui, control_type, attrs: _Builder(
taipy/gui/_renderers/factory.py
26
Python
0.286
suggestion
44
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied...
"linear" => "linear={false}" ?
# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied...
@@ -0,0 +1,60 @@ +# Copyright 2021-2024 Avaiga Private Limited +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required b...
tests/gui/control/test_progress.py
26
Python
0.071
question
30
51
51
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
I thought it would be "defaultValue={50}" ?
# Copyright 2021-2024 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
@@ -0,0 +1,60 @@ +# Copyright 2021-2024 Avaiga Private Limited +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required b...
tests/gui/control/test_progress.py
23
Python
0.071
question
43
48
48
false
Created a new visual element - progress bar
1,303
Avaiga/taipy
12,680
Python
FredLL-Avaiga
yaten2302
# specific language governing permissions and limitations under the License. import abc import threading from queue import Empty, SimpleQueue from .event import Event class CoreEventConsumerBase(threading.Thread): """Abstract base class for implementing a Core event consumer. This class provides a framewor...
```suggestion registration_id, registered_queue = Notifier.register( ```
# specific language governing permissions and limitations under the License. import abc import threading from queue import Empty, SimpleQueue from .event import Event class CoreEventConsumerBase(threading.Thread): """Abstract base class for implementing a Core event consumer. This class provides a framewor...
@@ -32,10 +32,18 @@ def process_event(self, event: Event): print(f"Received event created at : {event.creation_date}") pass - consumer = MyEventConsumer("consumer_1", event_queue) + registration_id, registered_queue = Notifier.unregister(
taipy/core/notification/core_event_consumer.py
26
Python
0.571
suggestion
78
51
51
false
Feature/#405 exposing notification mechanism to user
1,304
Avaiga/taipy
12,680
Python
jrobinAV
toan-quach