3b1b / 3b1b/videos

VectorField not properly instantiated?

Open Beginner friendly
#117 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.2k
Forks
2.1k
Avg merge
5h 49m
Merged PRs (30d)
3

Description

In [_2024/holograms/diffraction.py](https://github.com/3b1b/videos/blob/master/_2024/holograms/diffraction.py), there is an instance of VectorField that is missing the coordinate_system argument on line 400:
```
linear_field = VectorField(field_func, sample_points=wave_line.get_points()[::4], max_vect_len=2.0)
```

Is this an error or is the code supposed to run normally?

Error message:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 7
4 result[:, 1] = wave_amp_tracker.get_value() * wave.wave_func(points)
5 return result
----> 7 linear_field = VectorField(field_func, sample_points=wave_line.get_points()[::4], max_vect_len=2.0)
wave_line =
8 linear_field.always.update_vectors()
9 linear_field.set_stroke(WHITE, width=1.5, opacity=0.75)

TypeError: VectorField.__init__() missing 1 required positional argument: 'coordinate_system'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Look at the VectorField class definition in the manim library to see its __init__ signature. The error indicates a missing 'coordinate_system' argument. Check how VectorField is instantiated elsewhere in the codebase for correct usage. Update line 400 in _2024/holograms/diffraction.py to include the required argument, then run the script to verify the fix.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.