text stringlengths 19 585k | label stringclasses 2
values | category stringclasses 2
values | language stringclasses 14
values | repo stringclasses 932
values | sha stringlengths 40 40 |
|---|---|---|---|---|---|
@@ -15,41 +15,46 @@ let private ijkXyz = GitHub { Owner = "ijk"; Project = "xyz" }
[<Fact>]
let ``Command.parse works correctly`` () =
let cases = [
- (Result.Ok (Command.Init, defaultLoggingLevel), "init");
+ (Result.Ok (Command.Init, defaultLoggingLevel, RemoteFirst), "init");
- (Result.Ok (Command.In... | bad | review | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
diff --git a/buckaroo-tests/Command.fs b/buckaroo-tests/Command.fs
index 0351926..a002f85 100644
--- a/buckaroo-tests/Command.fs
+++ b/buckaroo-tests/Command.fs
@@ -15,32 +15,37 @@ let private ijkXyz = GitHub { Owner = "ijk"; Project = "xyz" }
[<Fact>]
let ``Command.parse works correctly`` () =
let cases = [
- ... | good | review_fixed | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
@@ -170,13 +177,16 @@ module Command =
do! CharParsers.spaces
+ let! isCacheFirst = cacheFirstParser
+ do! CharParsers.spaces
let! isVerbose = verboseParser
do! CharParsers.spaces
let loggingLevel = if isVerbose then LoggingLevel.Trace else LoggingLevel.Info
+ let fetchStyle = if is... | bad | review | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
diff --git a/buckaroo/Command.fs b/buckaroo/Command.fs
index 7e6c9c3..8f7d460 100644
--- a/buckaroo/Command.fs
+++ b/buckaroo/Command.fs
@@ -31,6 +31,13 @@ module Command =
return Option.isSome maybeSkip
}
+ let cacheFirstParser : Parser<bool, Unit> = parse {
+ let! cacheFirst =
+ CharParsers.skipStr... | good | review_fixed | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
@@ -30,7 +30,7 @@ let private getCachePath = async {
| path -> path
}
-let getContext loggingLevel = async {
+let getContext loggingLevel (fetchStyle : FetchStyle) = async { | bad | review | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
diff --git a/buckaroo/Tasks.fs b/buckaroo/Tasks.fs
index 9cd0593..7f6d24b 100644
--- a/buckaroo/Tasks.fs
+++ b/buckaroo/Tasks.fs
@@ -30,7 +30,7 @@ let private getCachePath = async {
| path -> path
}
-let getContext loggingLevel = async {
+let getContext loggingLevel fetchStyle = async {
let consoleManager = ... | good | review_fixed | fsharp | LoopPerfect/buckaroo | e6f9b9ed16fa10442621d7937fa0e7d9a5900e5a |
@@ -10,9 +10,9 @@ type DefaultSourceExplorer (console : ConsoleManager, downloadManager : Download
let toOptional = Async.Catch >> (Async.map Choice.toOption)
let fromFileCache url revision path =
- gitManager.FetchFile url revision path |> toOptional
+ gitManager.getFile url revision path |> toOptional
... | bad | review | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
diff --git a/buckaroo/DefaultSourceExplorer.fs b/buckaroo/DefaultSourceExplorer.fs
index d4d7ed0..f7ac277 100644
--- a/buckaroo/DefaultSourceExplorer.fs
+++ b/buckaroo/DefaultSourceExplorer.fs
@@ -10,13 +10,13 @@ type DefaultSourceExplorer (console : ConsoleManager, downloadManager : Download
let toOptional = Async.... | good | review_fixed | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
@@ -115,40 +117,62 @@ type GitCli (console : ConsoleManager) =
|> Async.Ignore
}
- member this.FetchBranch (repository : String) (branch : Branch) = async {
+ member this.FetchBranch (repository : String) (branch : Branch) (depth : int) = async {
let gitDir = repository
+ let depthStr ... | bad | review | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
diff --git a/buckaroo/GitCli.fs b/buckaroo/GitCli.fs
index c172f37..fe8b809 100644
--- a/buckaroo/GitCli.fs
+++ b/buckaroo/GitCli.fs
@@ -4,6 +4,8 @@ open System
open System.Text
open Buckaroo.Console
open RichOutput
+open FSharp.Control
+open FSharpx
type GitCli (console : ConsoleManager) =
@@ -115,40 +117,65 @... | good | review_fixed | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
@@ -210,7 +206,11 @@ type GitLib (console : ConsoleManager) =
member this.RemoteRefs (url : String) = async {
do! Async.SwitchToThreadPool()
+ System.Console.WriteLine url | bad | review | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
diff --git a/buckaroo/GitLib.fs b/buckaroo/GitLib.fs
index e693ada..4f57f06 100644
--- a/buckaroo/GitLib.fs
+++ b/buckaroo/GitLib.fs
@@ -6,6 +6,7 @@ open LibGit2Sharp
open LibGit2Sharp.Handlers
open FSharpx
open Buckaroo.Console
+open FSharp.Control
type GitLib (console : ConsoleManager) =
@@ -93,6 +94,12 @@ ty... | good | review_fixed | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
@@ -210,7 +206,11 @@ type GitLib (console : ConsoleManager) =
member this.RemoteRefs (url : String) = async {
do! Async.SwitchToThreadPool()
+ System.Console.WriteLine url
return Repository.ListRemoteReferences(url)
+ |> Seq.filter(fun ref ->
+ ref.CanonicalName.Contains("refs/... | bad | review | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
diff --git a/buckaroo/GitLib.fs b/buckaroo/GitLib.fs
index e693ada..4f57f06 100644
--- a/buckaroo/GitLib.fs
+++ b/buckaroo/GitLib.fs
@@ -6,6 +6,7 @@ open LibGit2Sharp
open LibGit2Sharp.Handlers
open FSharpx
open Buckaroo.Console
+open FSharp.Control
type GitLib (console : ConsoleManager) =
@@ -93,6 +94,12 @@ ty... | good | review_fixed | fsharp | LoopPerfect/buckaroo | 486e86a0acc0db043f3fe51bbfb2a061c00f5dca |
@@ -815,6 +815,24 @@ private void BtnSetMoveArea_DetectScreen_Click(object sender, RoutedEventArgs e)
// 如果无法获取 DPI 信息,回退到未调整的边界
mwCtrl.ScreenBorder = currentScreen.Bounds;
}
+
+ try
+ {
+ var screens = System.Windows.Forms.Scre... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
index b1db7a1e8..4855afa83 100644
--- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
+++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
@@ -67,6 +67,7 @@ public winGameSet... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -28,6 +28,15 @@ public interface IController
/// 获取桌宠距离下方的位置
/// </summary>
double GetWindowsDistanceDown();
+ /// <summary>
+ /// 获取桌宠所在屏幕是否为活动屏幕
+ /// </summary>
+ /// <returns></returns>
+ bool IfInActivateScreen();
+ /// <summary>
+ /// ... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Core/Handle/IController.cs b/VPet-Simulator.Core/Handle/IController.cs
index 9ec7a29cd..d5af72f3a 100644
--- a/VPet-Simulator.Core/Handle/IController.cs
+++ b/VPet-Simulator.Core/Handle/IController.cs
@@ -28,6 +28,15 @@ public interface IController
/// 获取桌宠距离下方的位置
/// </sum... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -537,8 +537,12 @@ public void EventTimer_Elapsed()
/// <returns>是否成功进入侧边隐藏模式</returns>
private bool MoveSideHideCheck()
{
+ if(Core.Controller.IfInActivateScreen() == false && Core.Controller.AutoChangeWindow) | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs
index 9d71568e2..9b5b199df 100644
--- a/VPet-Simulator.Core/Display/MainLogic.cs
+++ b/VPet-Simulator.Core/Display/MainLogic.cs
@@ -537,6 +537,10 @@ public void EventTimer_Elapsed()
/// <returns>是否成功进入侧边隐藏模式</retur... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -302,6 +302,16 @@ public bool EnableFunction
this["gameconfig"].SetBool("nofunction", !value);
}
}
+ bool autochangewindow;
+ public bool AutoChangeWindow
+ {
+ get => !autochangewindow;
+ set
+ {
+ autochange... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Windows/Function/Setting.cs b/VPet-Simulator.Windows/Function/Setting.cs
index d89123bd7..6b0a1a04d 100644
--- a/VPet-Simulator.Windows/Function/Setting.cs
+++ b/VPet-Simulator.Windows/Function/Setting.cs
@@ -38,6 +38,7 @@ public Setting(MainWindow mw, string lps) : base(lps)
en... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -28,6 +28,15 @@ public interface IController
/// 获取桌宠距离下方的位置
/// </summary>
double GetWindowsDistanceDown();
+ /// <summary>
+ /// 获取桌宠所在屏幕是否为活动屏幕
+ /// </summary>
+ /// <returns></returns>
+ bool IfInActivateScreen(); | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Core/Handle/IController.cs b/VPet-Simulator.Core/Handle/IController.cs
index 9ec7a29cd..d5af72f3a 100644
--- a/VPet-Simulator.Core/Handle/IController.cs
+++ b/VPet-Simulator.Core/Handle/IController.cs
@@ -28,6 +28,15 @@ public interface IController
/// 获取桌宠距离下方的位置
/// </sum... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -557,6 +563,8 @@ private bool MoveSideHideCheck()
if (Core.Graph.FindName(GraphType.SideHide_Right_Main) != null)
{
Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + 500 - Core.Graph.GraphConfig.Data["side"][(gdb... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs
index 9d71568e2..9b5b199df 100644
--- a/VPet-Simulator.Core/Display/MainLogic.cs
+++ b/VPet-Simulator.Core/Display/MainLogic.cs
@@ -537,6 +537,10 @@ public void EventTimer_Elapsed()
/// <returns>是否成功进入侧边隐藏模式</retur... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -1,4 +1,10 @@
-using System.Drawing;
+using Panuon.WPF.UI;
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows; | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs
index 1b1b4e62d..e1be4692f 100644
--- a/VPet-Simulator.Windows/Function/MWController.cs
+++ b/VPet-Simulator.Windows/Function/MWController.cs
@@ -1,4 +1,10 @@
-using System.Drawing;
+using Panuon.WPF.UI;
+us... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -93,6 +100,89 @@ public void MoveWindows(double X, double Y)
});
}
+ public bool IfInActivateScreen()
+ {
+ try
+ {
+ if (mw.Dispatcher.HasShutdownStarted || mw.Dispatcher.HasShutdownFinished) return false;
+ if (mw.winSetting ... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs
index 1b1b4e62d..e1be4692f 100644
--- a/VPet-Simulator.Windows/Function/MWController.cs
+++ b/VPet-Simulator.Windows/Function/MWController.cs
@@ -1,4 +1,10 @@
-using System.Drawing;
+using Panuon.WPF.UI;
+us... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -93,6 +100,89 @@ public void MoveWindows(double X, double Y)
});
}
+ public bool IfInActivateScreen()
+ {
+ try
+ {
+ if (mw.Dispatcher.HasShutdownStarted || mw.Dispatcher.HasShutdownFinished) return false;
+ if (mw.winSetting ... | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs
index 1b1b4e62d..e1be4692f 100644
--- a/VPet-Simulator.Windows/Function/MWController.cs
+++ b/VPet-Simulator.Windows/Function/MWController.cs
@@ -1,4 +1,10 @@
-using System.Drawing;
+using Panuon.WPF.UI;
+us... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -1,5 +1,6 @@
using LinePutScript.Converter;
using LinePutScript.Localization.WPF;
+using Panuon.WPF.UI; | bad | review | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs
index 5177c9e91..48be2ef39 100644
--- a/VPet-Simulator.Core/Display/MainDisplay.cs
+++ b/VPet-Simulator.Core/Display/MainDisplay.cs
@@ -374,7 +374,7 @@ private void DisplayRaising(string name = null)
... | good | review_fixed | csharp | LorisYounger/VPet | ce419a1de9a8fc2503236b71d510166cf69a8d87 |
@@ -597,10 +597,10 @@ public void LoadLatestSave(string petname)
//看看有没有备份,和备份对比下 (新建游戏)
if (Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves_BKP"))
{
- var bks = new DirectoryInfo(ExtensionValue.BaseDirectory + @"\Saves_BKP")
- .GetFiles(... | bad | review | csharp | LorisYounger/VPet | 17713f817d115c62a12d1eb91bc75844b3c6f6ed |
diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs
index 9318442bd..e4b8082af 100644
--- a/VPet-Simulator.Windows/MainWindow.xaml.cs
+++ b/VPet-Simulator.Windows/MainWindow.xaml.cs
@@ -597,10 +597,10 @@ public void LoadLatestSave(string petname)
//看看有没有备份,和备份... | good | review_fixed | csharp | LorisYounger/VPet | 17713f817d115c62a12d1eb91bc75844b3c6f6ed |
@@ -102,9 +103,9 @@
<!-- IsToday, IsTodayHighlighted and IsSelected -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
- <Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorTyp... | bad | review | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
diff --git a/src/MahApps.Metro/Styles/Controls.Calendar.xaml b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
index 9e57442294..cd606b1215 100644
--- a/src/MahApps.Metro/Styles/Controls.Calendar.xaml
+++ b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.micr... | good | review_fixed | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
@@ -114,8 +115,8 @@
<!-- IsToday and IsTodayHighlighted -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
- <Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Ca... | bad | review | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
diff --git a/src/MahApps.Metro/Styles/Controls.Calendar.xaml b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
index 9e57442294..cd606b1215 100644
--- a/src/MahApps.Metro/Styles/Controls.Calendar.xaml
+++ b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.micr... | good | review_fixed | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
@@ -291,7 +292,7 @@
FontWeight="Bold"
Foreground="{DynamicResource MahApps.Brushes.ThemeForeground}"
Opacity="0.8"
- Text="{Binding}" />
+ ... | bad | review | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
diff --git a/src/MahApps.Metro/Styles/Controls.Calendar.xaml b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
index 9e57442294..cd606b1215 100644
--- a/src/MahApps.Metro/Styles/Controls.Calendar.xaml
+++ b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.micr... | good | review_fixed | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
@@ -394,11 +395,11 @@
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_DisabledVisual" Property="Visibility" Value="Visible" />
</Trigger>
- <DataTrigger Binding="{Binding DisplayMode, RelativeSour... | bad | review | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
diff --git a/src/MahApps.Metro/Styles/Controls.Calendar.xaml b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
index 9e57442294..cd606b1215 100644
--- a/src/MahApps.Metro/Styles/Controls.Calendar.xaml
+++ b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.micr... | good | review_fixed | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
@@ -394,11 +395,11 @@
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_DisabledVisual" Property="Visibility" Value="Visible" />
</Trigger>
- <DataTrigger Binding="{Binding DisplayMode, RelativeSour... | bad | review | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
diff --git a/src/MahApps.Metro/Styles/Controls.Calendar.xaml b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
index 9e57442294..cd606b1215 100644
--- a/src/MahApps.Metro/Styles/Controls.Calendar.xaml
+++ b/src/MahApps.Metro/Styles/Controls.Calendar.xaml
@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.micr... | good | review_fixed | MahApps/MahApps.Metro | 1a3e4dd48344664e00a4b8e57c35b45e471c3876 | |
@@ -679,8 +679,11 @@ def _populate_edge_dict(
"""Helper method for populating the edges of the graph."""
raise NotImplementedError("To be implemented in concrete subclasses")
- def __getitem__(self: Graph, v: Hashable) -> Mobject:
- return self.vertices[v]
+ def __getitem__(self: Graph,... | bad | review | python | ManimCommunity/manim | 4695b73c0ed5f61c835cfa095b2593be2c88fbbc |
diff --git a/manim/mobject/graph.py b/manim/mobject/graph.py
index 7eaee412b4..f6bbe681ee 100644
--- a/manim/mobject/graph.py
+++ b/manim/mobject/graph.py
@@ -669,8 +669,13 @@ def _populate_edge_dict(
"""Helper method for populating the edges of the graph."""
raise NotImplementedError("To be implement... | good | review_fixed | python | ManimCommunity/manim | 4695b73c0ed5f61c835cfa095b2593be2c88fbbc |
@@ -136,21 +136,19 @@ def test_mobject_dimensions_nested_mobjects():
def test_mobject_dimensions_mobjects_with_no_points_are_at_origin(): | bad | review | python | ManimCommunity/manim | f53b515df40e5e719d024a4404aebe84a58e5b2b |
diff --git a/tests/module/mobject/mobject/test_mobject.py b/tests/module/mobject/mobject/test_mobject.py
index 203d312627..a7eaee6446 100644
--- a/tests/module/mobject/mobject/test_mobject.py
+++ b/tests/module/mobject/mobject/test_mobject.py
@@ -3,7 +3,20 @@
import numpy as np
import pytest
-from manim import DL, ... | good | review_fixed | python | ManimCommunity/manim | f53b515df40e5e719d024a4404aebe84a58e5b2b |
@@ -0,0 +1,262 @@
+from __future__ import annotations
+
+import numpy as np
+import numpy.testing as nt
+import pytest
+
+from manim.utils.color import (
+ BLACK,
+ BLUE,
+ GREEN,
+ RED,
+ WHITE,
+ YELLOW,
+ ManimColor,
+)
+from manim.utils.color.core import (
+ RandomColorGenerator,
+ averag... | bad | review | python | ManimCommunity/manim | e54947b8eb2d7b6479210f891ec15aa97bea522d |
diff --git a/tests/module/utils/test_color_helpers.py b/tests/module/utils/test_color_helpers.py
new file mode 100644
index 0000000000..13c3cb0346
--- /dev/null
+++ b/tests/module/utils/test_color_helpers.py
@@ -0,0 +1,264 @@
+from __future__ import annotations
+
+import numpy as np
+import numpy.testing as nt
+import ... | good | review_fixed | python | ManimCommunity/manim | e54947b8eb2d7b6479210f891ec15aa97bea522d |
@@ -1941,30 +1941,35 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr_start, curr_end = self.get_start_and_end()
- curr_vect = curr_end - curr_start
- if np.all(curr_vect == 0):
- # TODO: this looks broken. ... | bad | review | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 9f3818c188..721ce57356 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1941,30 +1941,33 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr... | good | review_fixed | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
@@ -1941,30 +1941,35 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr_start, curr_end = self.get_start_and_end()
- curr_vect = curr_end - curr_start
- if np.all(curr_vect == 0):
- # TODO: this looks broken. ... | bad | review | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 9f3818c188..721ce57356 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1941,30 +1941,33 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr... | good | review_fixed | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
@@ -2134,26 +2134,35 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr_start, curr_end = self.get_start_and_end()
- curr_vect = curr_end - curr_start
- if np.all(curr_vect == 0):
- raise Exception("Cannot pos... | bad | review | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py
index 52cb3f3ac2..e624dc2e58 100644
--- a/manim/mobject/opengl/opengl_mobject.py
+++ b/manim/mobject/opengl/opengl_mobject.py
@@ -6,6 +6,7 @@
import random
import sys
import types
+import warnings
from collections.abc impor... | good | review_fixed | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
@@ -2134,26 +2135,32 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr_start, curr_end = self.get_start_and_end()
- curr_vect = curr_end - curr_start
- if np.all(curr_vect == 0):
- raise Exception("Cannot pos... | bad | review | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py
index 52cb3f3ac2..e624dc2e58 100644
--- a/manim/mobject/opengl/opengl_mobject.py
+++ b/manim/mobject/opengl/opengl_mobject.py
@@ -6,6 +6,7 @@
import random
import sys
import types
+import warnings
from collections.abc impor... | good | review_fixed | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
@@ -1941,30 +1941,32 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr_start, curr_end = self.get_start_and_end()
- curr_vect = curr_end - curr_start
- if np.all(curr_vect == 0):
- # TODO: this looks broken. ... | bad | review | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 9f3818c188..721ce57356 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1941,30 +1941,33 @@ def surround(
return self
def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self:
- curr... | good | review_fixed | python | ManimCommunity/manim | ab7224add0160e27219d92bb3ef846e389a2c634 |
@@ -369,6 +369,41 @@ def construct(self):
sphere3 = Sphere(center=(-1, 2, 0), radius=2, resolution=(16, 16))
sphere3.set_color(BLUE)
self.add(sphere3)
+
+ This example shows that overlapping spheres can intersect with rough transitions.
+ .. manim:: ExampleSphere... | bad | review | python | ManimCommunity/manim | a2f0ec61e1b16046815f1b5960f00478b4fb6caf |
diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py
index 48297a67da..f2698de7e8 100644
--- a/manim/mobject/three_d/three_dimensions.py
+++ b/manim/mobject/three_d/three_dimensions.py
@@ -379,13 +379,7 @@ class Sphere(Surface):
class ExampleSphere(ThreeDScene):
... | good | review_fixed | python | ManimCommunity/manim | a2f0ec61e1b16046815f1b5960f00478b4fb6caf |
@@ -358,8 +358,8 @@ def construct(self):
center=(3, 0, 0),
radius=1,
resolution=(20, 20),
- u_range=[0.001, PI - 0.001],
- v_range=[0, TAU]
+ u_range=[0, TAU],
+ v_range=[0, PI] | bad | review | python | ManimCommunity/manim | a2f0ec61e1b16046815f1b5960f00478b4fb6caf |
diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py
index 48297a67da..f2698de7e8 100644
--- a/manim/mobject/three_d/three_dimensions.py
+++ b/manim/mobject/three_d/three_dimensions.py
@@ -379,13 +379,7 @@ class Sphere(Surface):
class ExampleSphere(ThreeDScene):
... | good | review_fixed | python | ManimCommunity/manim | a2f0ec61e1b16046815f1b5960f00478b4fb6caf |
@@ -172,7 +172,7 @@ def auto_zoom(
margin: float = 0,
only_mobjects_in_frame: bool = False,
animate: bool = True,
- ) -> Mobject:
+ ) -> _AnimationBuilder | Mobject: | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/camera/moving_camera.py b/manim/camera/moving_camera.py
index af1fbb22a9..3bb61120d2 100644
--- a/manim/camera/moving_camera.py
+++ b/manim/camera/moving_camera.py
@@ -10,7 +10,7 @@
__all__ = ["MovingCamera"]
from collections.abc import Iterable
-from typing import Any
+from typing import Any, Li... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -376,9 +376,9 @@ def test(tex1: str, tex2: str) -> bool:
return VGroup(*(m for m in self.submobjects if test(tex, m.get_tex_string())))
- def get_part_by_tex(self, tex: str, **kwargs: Any) -> MathTex | None:
+ def get_part_by_tex(self, tex: str, **kwargs: Any) -> VMobject | None:
all_part... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/text/tex_mobject.py b/manim/mobject/text/tex_mobject.py
index 8698e024b8..729fbb158b 100644
--- a/manim/mobject/text/tex_mobject.py
+++ b/manim/mobject/text/tex_mobject.py
@@ -587,7 +587,7 @@ def set_color_by_tex_to_color_map(
self.id_to_vgroup_dict[match[1]].set_color(co... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -166,9 +166,12 @@ def __init__(
lines_str_list = lines_str.split("\n")
self.chars = self._gen_chars(lines_str_list)
- self.lines = [list(self.chars), [self.alignment] * len(self.chars)]
- self.lines_initial_positions = [line.get_center() for line in self.lines[0]]
- self.add(... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/text/text_mobject.py b/manim/mobject/text/text_mobject.py
index 812a6b084f..d484420301 100644
--- a/manim/mobject/text/text_mobject.py
+++ b/manim/mobject/text/text_mobject.py
@@ -166,9 +166,12 @@ def __init__(
lines_str_list = lines_str.split("\n")
self.chars = self._gen_ch... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -1285,19 +1288,23 @@ def add_line_to(end: Point3D) -> None:
if self.gradient:
self.set_color_by_gradient(*self.gradient)
for col in colormap:
- self.chars[
+ chars = self.chars[
col["start"] - col["start_offset"] : col["end"]
- co... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/text/text_mobject.py b/manim/mobject/text/text_mobject.py
index 812a6b084f..d484420301 100644
--- a/manim/mobject/text/text_mobject.py
+++ b/manim/mobject/text/text_mobject.py
@@ -166,9 +166,12 @@ def __init__(
lines_str_list = lines_str.split("\n")
self.chars = self._gen_ch... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -1285,19 +1288,23 @@ def add_line_to(end: Point3D) -> None:
if self.gradient:
self.set_color_by_gradient(*self.gradient)
for col in colormap:
- self.chars[
+ chars = self.chars[
col["start"] - col["start_offset"] : col["end"]
- co... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/text/text_mobject.py b/manim/mobject/text/text_mobject.py
index 812a6b084f..d484420301 100644
--- a/manim/mobject/text/text_mobject.py
+++ b/manim/mobject/text/text_mobject.py
@@ -166,9 +166,12 @@ def __init__(
lines_str_list = lines_str.split("\n")
self.chars = self._gen_ch... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -172,7 +171,7 @@ def __init__(
bracket_v_buff: float = MED_SMALL_BUFF,
add_background_rectangles_to_entries: bool = False,
include_background_rectangle: bool = False,
- element_to_mobject: type[Mobject] | Callable[..., Mobject] = MathTex,
+ element_to_mobject: type[VMobject] ... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -172,7 +171,7 @@ def __init__(
bracket_v_buff: float = MED_SMALL_BUFF,
add_background_rectangles_to_entries: bool = False,
include_background_rectangle: bool = False,
- element_to_mobject: type[Mobject] | Callable[..., Mobject] = MathTex,
+ element_to_mobject: type[VMobject] ... | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -207,7 +206,7 @@ def __init__(
if self.include_background_rectangle:
self.add_background_rectangle()
- def _matrix_to_mob_matrix(self, matrix: np.ndarray) -> list[list[Mobject]]:
+ def _matrix_to_mob_matrix(self, matrix: np.ndarray) -> list[list[VMobject]]: | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -485,7 +484,7 @@ def construct(self):
def __init__(
self,
matrix: Iterable, | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -485,7 +484,7 @@ def construct(self):
def __init__(
self,
matrix: Iterable,
- element_to_mobject: type[Mobject] = DecimalNumber,
+ element_to_mobject: type[VMobject] = DecimalNumber, | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -530,7 +529,7 @@ def construct(self):
def __init__(
self,
matrix: Iterable, | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -530,7 +529,7 @@ def construct(self):
def __init__(
self,
matrix: Iterable,
- element_to_mobject: type[Mobject] = Integer,
+ element_to_mobject: type[VMobject] = Integer, | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -568,7 +567,7 @@ def construct(self):
def __init__(
self,
matrix: Iterable, | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 5a965cc655..73fc7b4e53 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -40,15 +40,15 @@ def construct(self):
import itertools as it
-from collections.abc import Callable, Iterable, Sequence
+from collections.abc import Calla... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -17,7 +17,7 @@
from collections.abc import Callable, Iterable | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 14738d22a7..9f3818c188 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -14,10 +14,10 @@
import sys
import types
import warnings
-from collections.abc import Callable, Iterable
+from collections.abc import Callable, Iterabl... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -41,25 +41,35 @@
from ..utils.space_ops import angle_between_vectors, normalize, rotation_matrix
if TYPE_CHECKING:
+ from collections.abc import Iterator | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 14738d22a7..9f3818c188 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -14,10 +14,10 @@
import sys
import types
import warnings
-from collections.abc import Callable, Iterable
+from collections.abc import Callable, Iterabl... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -17,7 +17,7 @@
from collections.abc import Callable, Iterable
from functools import partialmethod, reduce
from pathlib import Path
-from typing import TYPE_CHECKING, Any, Literal
+from typing import TYPE_CHECKING, Any, Literal, cast | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 14738d22a7..9f3818c188 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -14,10 +14,10 @@
import sys
import types
import warnings
-from collections.abc import Callable, Iterable
+from collections.abc import Callable, Iterabl... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
@@ -41,25 +41,35 @@
from ..utils.space_ops import angle_between_vectors, normalize, rotation_matrix
if TYPE_CHECKING:
+ from collections.abc import Iterator
+ from typing import Any, Callable, Literal | bad | review | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 14738d22a7..9f3818c188 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -14,10 +14,10 @@
import sys
import types
import warnings
-from collections.abc import Callable, Iterable
+from collections.abc import Callable, Iterabl... | good | review_fixed | python | ManimCommunity/manim | 0d2ad520a435905841ae46d7135a424f65df22ba |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.