internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: sunpy/sunpy

Issue:
Improve Map __str__
`Map` has an nice `__repr__`, but currently `print(map)` just prints the data array. It would be nice if `print(map)` could print some extra info like in `__repr__` (maybe even the same info?).


Discussion:
:+1: for all `__repr__`'s being `return f"{object.__repr__(self)}\n{self}"`.
Is this issue up? I would like to work on this issue.
Should be.
> Should be.

On it!
@nabobalis Was not able to find any __str__ in maps,  are they present or shall I add them
They aren't present in Generic Map as far as I am aware.
> They aren't present in Generic Map as far as I am aware.

Shall I add them , same as repr?
Yeah.
> Yeah.

Okay😁

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -254,8 +254,11 @@ def _text_summary(self):
                                                     self._reference_latitude)),
                                tmf=TIME_FORMAT)
 
+    def __str__(self):
+        return f"{self._text_summary()}\n{self.data.__repr__()}"
+
     def __repr__(self):
-        return object.__repr__(self) + "\n" + self._text_summary() + "\n" + self.data.__repr__()
+        return f"{object.__repr__(self)}\n{self}"
 
     def _repr_html_(self):
         """


Test patch:
diff --git a/sunpy/map/tests/test_mapbase.py b/sunpy/map/tests/test_mapbase.py
--- a/sunpy/map/tests/test_mapbase.py
+++ b/sunpy/map/tests/test_mapbase.py
@@ -1101,3 +1101,12 @@ def test_contour(simple_map):
     assert contour.obstime == simple_map.date
     assert u.allclose(contour.Tx, [0, -1, 0, 1, 0] * u.arcsec, atol=1e-10 * u.arcsec)
     assert u.allclose(contour.Ty, [0.5, 0, -0.5, 0, 0.5] * u.arcsec, atol=1e-10 * u.arcsec)
+
+
+def test_print_map(generic_map):
+    out_repr = generic_map.__repr__()
+    assert isinstance(out_repr, str)
+    assert object.__repr__(generic_map) in out_repr
+    out_str = generic_map.__str__()
+    assert isinstance(out_str, str)
+    assert out_str in out_repr
Repository: sunpy/sunpy

Issue:
sunpy logo link broken
The link to "sunpy logo" here: https://sunpy.org/about#acknowledging-sunpy-in-posters-and-talks just redirects to the same page instead of a logo.


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -67,7 +67,7 @@
 
 # For the linkcheck
 linkcheck_ignore = [r"https://doi.org/\d+",
-                    r"https://riot.im/\d+",
+                    r"https://element.io/\d+",
                     r"https://github.com/\d+",
                     r"https://docs.sunpy.org/\d+"]
 linkcheck_anchors = False


Test patch:
Repository: sunpy/sunpy

Issue:
Mapsequence.plot docstring lacks information on plot_function signature
it should either link to the animator docs or copy the function signature information


Discussion:

Resolving patch:
diff --git a/sunpy/map/mapsequence.py b/sunpy/map/mapsequence.py
--- a/sunpy/map/mapsequence.py
+++ b/sunpy/map/mapsequence.py
@@ -274,9 +274,17 @@ def plot(self, axes=None, resample=None, annotate=True,
             Animation interval in ms
 
         plot_function : function
-            A function to be called as each map is plotted. Any variables
-            returned from the function will have their ``remove()`` method called
-            at the start of the next frame so that they are removed from the plot.
+            A function to be called as each map is plotted.
+            For more information see `sunpy.visualization.MapSequenceAnimator`.
+
+        Returns
+        -------
+        `matplotlib.animation.FuncAnimation`
+            A FuncAnimation instance.
+
+        See Also
+        --------
+        `sunpy.visualization.mapsequenceanimator.MapSequenceAnimator`
 
         Examples
         --------
diff --git a/sunpy/visualization/animator/mapsequenceanimator.py b/sunpy/visualization/animator/mapsequenceanimator.py
--- a/sunpy/visualization/animator/mapsequenceanimator.py
+++ b/sunpy/visualization/animator/mapsequenceanimator.py
@@ -37,7 +37,7 @@ class MapSequenceAnimator(imageanimator.BaseFuncAnimator):
     plot_function : `function`
         A function to call when each `~sunpy.map.Map` is plotted, the function must have
         the signature ``(fig, axes, smap)`` where ``fig`` and ``axes`` are the figure and
-        axes objects of the plot and ``smap`` is the current frames `~sunpy.map.Map` object.
+        axes objects of the plot and ``smap`` is the current frame's `~sunpy.map.Map` object.
         Any objects returned from this function will have their ``remove()`` method
         called at the start of the next frame to clear them from the plot.
 


Test patch:
Repository: sunpy/sunpy

Issue:
You have to specify seconds on the time string arguments to a.Time now
I could have sworn you didn't used to have to do this.


Discussion:
What's a reproducible example?
`a.Time("2020/10/01T00:00", "2020/10/01T00:00")` no longer works when I am sure it used to.
```python
from sunpy.net import attrs
attrs.Time("2020/10/01T00:00", "2020/10/01T00:00")
```
Doesn't work for me on 2.0.x, 1.1.x, or 1.0.x, so I'm going to re-label this as a feature request.
I wonder if we lost this in the 1.0 time refactor then :thinking: 
Should be pretty easy to fix, just need to add another custom time format entry to `sunpy/time/time.py`
I am intrested in this issue and from the discussion it seems that I have to add `"%Y/%m/%dT%H:%M",  # Example 2007/05/04T21:08` in the `TIME_FORMAT_LIST` array in `sunpy/time/time.py` .
Probably should be enough. 

Resolving patch:
diff --git a/sunpy/time/time.py b/sunpy/time/time.py
--- a/sunpy/time/time.py
+++ b/sunpy/time/time.py
@@ -61,6 +61,7 @@
     "%Y:%j:%H:%M:%S.%f",  # Example 2012:124:21:08:12.999999
     "%Y%m%d%H%M%S",  # Example 20140101000001 (JSOC / VSO)
     "%Y.%m.%d_%H:%M:%S_TAI",  # Example 2016.05.04_21:08:12_TAI
+    "%Y/%m/%dT%H:%M",  # Example 2007/05/04T21:08
 ]
 
 


Test patch:
diff --git a/sunpy/net/tests/test_attrs.py b/sunpy/net/tests/test_attrs.py
--- a/sunpy/net/tests/test_attrs.py
+++ b/sunpy/net/tests/test_attrs.py
@@ -1,5 +1,6 @@
 from sunpy.net import attr
 from sunpy.net import attrs as a
+from sunpy.time import parse_time
 
 
 def test_time_subclass():
@@ -8,3 +9,9 @@ class NewTime(a.Time):
 
     assert isinstance(NewTime("2020/01/01", "2020/01/02") &
                       a.Time("2020/02/02", "2020/02/03"), attr.AttrAnd)
+
+
+def test_attrs_time():
+    times = a.Time("2020/10/01T00:00", "2020/10/01T00:00")
+    times.start == parse_time("2020/10/01T00:00")
+    times.end == parse_time("2020/10/01T00:00")
diff --git a/sunpy/time/tests/test_time.py b/sunpy/time/tests/test_time.py
--- a/sunpy/time/tests/test_time.py
+++ b/sunpy/time/tests/test_time.py
@@ -228,6 +228,7 @@ def test_parse_time_ISO():
         ('04-May-2007', dt5),
         ('04-May-2007 21:08:12.999999', dt2),
         ('20070504_210812', dt3),
+        ('2007/05/04T21:08', dt4),
     ]
 
     for k, v in lst:
Repository: sunpy/sunpy

Issue:
Fix CROTA in EUVI map source
e.g. 
```python
from sunpy.map import Map

smap = Map('https://stereo-ssc.nascom.nasa.gov/pub/beacon/ahead/secchi/img/euvi/20210107/20210107_001615_n7euA.fts')
print(smap.wcs)
```
raises
```
WARNING: FITSFixedWarning: CROTA = -6.39331135705 
keyword looks very much like CROTAn but isn't. [astropy.wcs.wcs]
```
It would be good to fix this in the EUVI map source.


Discussion:
yeah this has something that's been bugging me to, I have it fixed locally so can make PR if you aren't working on it @dstansby? 

Resolving patch:
diff --git a/sunpy/map/sources/stereo.py b/sunpy/map/sources/stereo.py
--- a/sunpy/map/sources/stereo.py
+++ b/sunpy/map/sources/stereo.py
@@ -8,6 +8,7 @@
 from astropy.visualization import PowerStretch
 from astropy.visualization.mpl_normalize import ImageNormalize
 
+from sunpy import log
 from sunpy.map import GenericMap
 from sunpy.map.sources.source_type import source_stretch
 
@@ -42,6 +43,10 @@ def __init__(self, data, header, **kwargs):
         # date FITS keyword
         if ('date_obs' in self.meta) and not('date-obs' in self.meta):
             self.meta['date-obs'] = self.meta['date_obs']
+        # fix CROTA to CROTAn
+        if "crota" in self.meta and "crota2" not in self.meta:
+            log.debug("EUVIMap: Changing the CROTA keyword to CROTA2")
+            self.meta["crota2"] = self.meta.pop("crota")
 
     @property
     def rsun_arcseconds(self):


Test patch:
Repository: sunpy/sunpy

Issue:
Add explicit signatures to Fido attribute documentation
Currently Fido attributes have a generic (`*args, **kwargs`) function signature in the docs: https://docs.sunpy.org/en/stable/code_ref/net.html#classes

It would be good to convert these to explicit function signatures, to allow users to more easily understand what arguments each attribute takes. It looks like the function signatures themselves are fine, but somehow they are being modified when sphinx is documenting them during the doc build.


Discussion:
Detective work on element has uncovered that this is because `DataAttr` has a `__new__(*args, **kwargs)`, which takes precedence over the `__init__` signatures defined in the sub-classes.
It looks like we can configure sphinx to use `__init__` as the main docstring instead of `__new__`: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration

(and pinging @Cadair since you said you were interested in the chat)
Hmm, is the problem solely wth Sphinx?  What does `help()` return?

Resolving patch:
diff --git a/sunpy/net/attr.py b/sunpy/net/attr.py
--- a/sunpy/net/attr.py
+++ b/sunpy/net/attr.py
@@ -14,6 +14,7 @@
 """
 import re
 import string
+import inspect
 import keyword
 import textwrap
 from textwrap import dedent
@@ -280,6 +281,23 @@ def __new__(cls, *args, **kwargs):
 
         return super().__new__(cls)
 
+    def __init_subclass__(cls, **kwargs):
+        super().__init_subclass__(**kwargs)
+
+        # Because __new__() is defined, this will block natural introspection of the arguments for
+        # __init__() in all subclasses because the signature of __new__() takes precedence over the
+        # signature of __init__().  We add a __new__() to all subclasses that do not explicitly
+        # define it with a signature that matches __init__().
+        if '__new__' not in cls.__dict__:
+            unsigned_new = cls.__new__  # the inherited __new__()
+
+            def signed_new(cls, *args, **kwargs):
+                return unsigned_new(cls, *args, **kwargs)
+
+            signed_new.__signature__ = inspect.signature(cls.__init__)
+
+            cls.__new__ = signed_new
+
 
 class DummyAttr(Attr):
     """


Test patch:
Repository: sunpy/sunpy

Issue:
Re-order and remove the deprecation on the submap and draw_rectangle parameters after the 2.0 release.

### Description
<!-- Provide a general description of the issue. -->
As [mentioned here](https://github.com/sunpy/sunpy/pull/3677#discussion_r409606416), the new API for specifying rectangular coordinates requires keyword-only arguments.
The current implementation has a decorator for deprecating the old API which will be supported until the official 2.0 release.
This is the issue to keep track of the eventual removal of the deprecation and the reordering of the parameters to submap and draw_rectangle.



Discussion:
Hi! I can do this. My email is: agarwal.sachin.samriddhi@gmail.com
If it is done, we can close this issue. 

Thanks for having a look at it @samriddhi-dev 

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -2055,8 +2055,8 @@ def draw_quadrangle(self, bottom_left, *, width: u.deg = None, height: u.deg = N
         return quad
 
     @u.quantity_input
-    def draw_rectangle(self, bottom_left, *, width: u.deg = None, height: u.deg = None,
-                       axes=None, top_right=None, **kwargs):
+    def draw_rectangle(self, bottom_left, *, top_right=None, width: u.deg = None, height: u.deg = None,
+                       axes=None, **kwargs):
         """
         Draw a rectangle defined in world coordinates on the plot.
 


Test patch:
Repository: sunpy/sunpy

Issue:
Update "Masking out the solar disk" example to use maputils function
Example: https://docs.sunpy.org/en/stable/generated/gallery/computer_vision_techniques/mask_disk.html

Update to use `sunpy.map.coordinate_is_on_solar_disk()`


Discussion:
Hi, by saying ```Update to use sunpy.map.coordinate_is_on_solar_disk()```, do you mean remove the usage of ```sunpy.map.all_coordinates_from_map``` or use ```sunpy.map.coordinate_is_on_solar_disk()``` instead of the mask?
Basically, replace the calculations to calculate the mask.  See this other example:
https://github.com/sunpy/sunpy/blob/164f57c41c6840d568dbfb211d38aa1ae83aaf65/examples/plotting/hmi_cutout.py#L35-L37

Resolving patch:
diff --git a/examples/computer_vision_techniques/mask_disk.py b/examples/computer_vision_techniques/mask_disk.py
--- a/examples/computer_vision_techniques/mask_disk.py
+++ b/examples/computer_vision_techniques/mask_disk.py
@@ -6,12 +6,10 @@
 How to mask out all emission from the solar disk.
 """
 import matplotlib.pyplot as plt
-import numpy as np
-import numpy.ma as ma
 
 import sunpy.map
 from sunpy.data.sample import AIA_171_IMAGE
-from sunpy.map.maputils import all_coordinates_from_map
+from sunpy.map.maputils import all_coordinates_from_map, coordinate_is_on_solar_disk
 
 ###############################################################################
 # We start with the sample data
@@ -19,22 +17,22 @@
 
 ###############################################################################
 # A utility function gives us access to the helioprojective coordinate of each
-# pixels. We can use that to create a new array which
-# contains the normalized radial position for each pixel.
+# pixels. We can use that to create a new array of all the coordinates
+# that are on the solar disk.
 hpc_coords = all_coordinates_from_map(aia)
-r = np.sqrt(hpc_coords.Tx ** 2 + hpc_coords.Ty ** 2) / aia.rsun_obs
 
 ###############################################################################
-# With this information, we create a mask where all values which are less then
-# the solar radius are masked. We also make a slight change to the colormap
-# so that masked values are shown as black instead of the default white.
-mask = ma.masked_less_equal(r, 1)
+# Now, we can create a mask from the coordinates by using another utility
+# function that gives us a mask that has `True` for those coordinates that are
+# on the solar disk. We also make a slight change to the colormap so that
+# masked values are shown as black instead of the default white.
+mask = coordinate_is_on_solar_disk(hpc_coords)
 palette = aia.cmap
 palette.set_bad('black')
 
 ###############################################################################
 # Finally we create a new map with our new mask.
-scaled_map = sunpy.map.Map(aia.data, aia.meta, mask=mask.mask)
+scaled_map = sunpy.map.Map(aia.data, aia.meta, mask=mask)
 
 ###############################################################################
 # Let's plot the results using our modified colormap


Test patch:
Repository: sunpy/sunpy

Issue:
`HMISynopticMap` is missing a docstring
`HMISynopticMap` has no docstring.  At minimum, it should at least have something analogous to what `MDISynopticMap` has:
https://github.com/sunpy/sunpy/blob/824f72026403001c65e23f24ced3ff5eb7d13a68/sunpy/map/sources/soho.py#L227-L229

However, it'd be better if it had more meat to it (e.g., explanation and references).


Discussion:

Resolving patch:
diff --git a/sunpy/map/sources/sdo.py b/sunpy/map/sources/sdo.py
--- a/sunpy/map/sources/sdo.py
+++ b/sunpy/map/sources/sdo.py
@@ -129,7 +129,19 @@ def is_datasource_for(cls, data, header, **kwargs):
 
 
 class HMISynopticMap(HMIMap):
+    """
+    SDO/HMI Synoptic Map.
+
+    Synoptic maps are constructed from HMI 720s line-of-sight magnetograms
+    collected over a 27-day solar rotation.
+
+    See `~sunpy.map.sources.sdo.HMIMap` for information on the HMI instrument.
 
+    References
+    ----------
+    * `SDO Mission Page <https://sdo.gsfc.nasa.gov/>`__
+    * `JSOC's HMI Synoptic Charts <http://jsoc.stanford.edu/HMI/LOS_Synoptic_charts.html>`__
+    """
     def __init__(self, data, header, **kwargs):
         super().__init__(data, header, **kwargs)
 


Test patch:
Repository: sunpy/sunpy

Issue:
Example gallery "Getting the observer location from a Map" seems broken RTD
Black plot since 2.1.2 https://docs.sunpy.org/en/latest/generated/gallery/units_and_coordinates/getting_observer_location.html#sphx-glr-generated-gallery-units-and-coordinates-getting-observer-location-py


Discussion:

Resolving patch:
diff --git a/examples/map_transformations/reprojection_aia_euvi_mosaic.py b/examples/map_transformations/reprojection_aia_euvi_mosaic.py
--- a/examples/map_transformations/reprojection_aia_euvi_mosaic.py
+++ b/examples/map_transformations/reprojection_aia_euvi_mosaic.py
@@ -79,12 +79,12 @@
 ax.text(earth.lon.to_value("rad")+0.05, earth.radius.to_value(r_unit), "Earth")
 
 for this_satellite, this_coord in [(m.observatory, m.observer_coordinate) for m in maps]:
-    plt.polar(this_coord.lon.to('rad'), this_coord.radius.to(r_unit), 'o', label=this_satellite)
+    ax.plot(this_coord.lon.to('rad'), this_coord.radius.to(r_unit), 'o', label=this_satellite)
 
 ax.set_theta_zero_location("S")
 ax.set_rlim(0, 1.3)
 
-plt.legend()
+ax.legend()
 plt.show()
 
 ######################################################################
diff --git a/examples/units_and_coordinates/getting_observer_location.py b/examples/units_and_coordinates/getting_observer_location.py
--- a/examples/units_and_coordinates/getting_observer_location.py
+++ b/examples/units_and_coordinates/getting_observer_location.py
@@ -42,8 +42,8 @@
 circle = plt.Circle((0.0, 0.0), 1.0, transform=ax.transProjectionAffine + ax.transAxes, color="green",
                     alpha=0.4, label="Earth")
 ax.add_artist(circle)
-plt.text(0.48, 0.5, "Earth", transform=ax.transAxes)
-plt.polar(sdo_gcrs.ra.to('rad'), sdo_gcrs.distance / R_earth, 'o', label=f'SDO {sdo_gcrs.dec:.2f}')
-plt.polar(sun.lon.to('rad').value * np.ones(2), [1, 10], '-', label='to Sun', color='black')
-plt.legend()
+ax.text(0.48, 0.5, "Earth", transform=ax.transAxes)
+ax.plot(sdo_gcrs.ra.to('rad'), sdo_gcrs.distance / R_earth, 'o', label=f'SDO {sdo_gcrs.dec:.2f}')
+ax.plot(sun.lon.to('rad').value * np.ones(2), [1, 10], '-', label='to Sun', color='black')
+ax.legend()
 plt.show()
diff --git a/examples/units_and_coordinates/planet_locations.py b/examples/units_and_coordinates/planet_locations.py
--- a/examples/units_and_coordinates/planet_locations.py
+++ b/examples/units_and_coordinates/planet_locations.py
@@ -23,8 +23,9 @@
 ##############################################################################
 # Let's plot the results. Remember the Sun is at the center of this coordinate
 # system.
+fig = plt.figure()
 ax = plt.subplot(projection='polar')
 for this_planet, this_coord in zip(planet_list, planet_coord):
-    plt.polar(this_coord.lon.to('rad'), this_coord.radius, 'o', label=this_planet)
-plt.legend()
+    ax.plot(this_coord.lon.to('rad'), this_coord.radius, 'o', label=this_planet)
+ax.legend()
 plt.show()


Test patch:
Repository: sunpy/sunpy

Issue:
Provide an example of splitting sections of an attr query out of the Fido.search method.
@Cadair's had this snippet of code

``` python
import datetime
from sunpy.net import vso
from sunpy.time import parse_time

# Start time and end time for the AIA search
start = parse_time('2014/07/17T10:01:30')
stop = start + datetime.timedelta(seconds=12)
stop_hmi = start + datetime.timedelta(seconds=30)

# Define two VSO Searches for the AIA data and the HMI data
search_aia = (vso.attrs.Time(start, stop), vso.attrs.Instrument('AIA'))
search_hmi = (vso.attrs.Time(start, stop_hmi), vso.attrs.Instrument('HMI'),
              vso.attrs.Physobs('LOS_magnetic_field'))

# Create the VSO Client
vsoClient = vso.VSOClient()

# Query VSO for both searches using the or operator `|`
results = vsoClient.query(search_aia | search_hmi)
```

That used to work but now I get this error. 

``` python
TypeError: unsupported operand type(s) for |: 'tuple' and 'tuple'
```

Should this operation be possible? 



Discussion:
I think this should work:

``` python
search_aia = (vso.attrs.Time(start, stop) & vso.attrs.Instrument('AIA'))
search_hmi = (vso.attrs.Time(start, stop_hmi) &  vso.attrs.Instrument('HMI') & vso.attrs.Physobs('LOS_magnetic_field'))

results = vso.VSOClient.query(search_aia | search_hmi)
```

maybe.

``` python
TypeError: unbound method query() must be called with VSOClient instance as first argument (got AttrOr instance instead)
```

ok, the `vso.VSOClient` should be an instance not the object.

That fixed it. Doesn't error now. 

Is there an example of this in the docs?

No?

your up @nabobalis  :p

If i have too. Stupid crappy text format. 

See #1488


Resolving patch:
diff --git a/examples/acquiring_data/searching_vso.py b/examples/acquiring_data/searching_vso.py
--- a/examples/acquiring_data/searching_vso.py
+++ b/examples/acquiring_data/searching_vso.py
@@ -41,3 +41,15 @@
                      a.Instrument.aia,
                      a.Wavelength(171*u.angstrom) | a.Wavelength(94*u.angstrom))
 print(result)
+
+###############################################################################
+# We can even combine entire queries in this manner.
+# Here we will define two searches for the AIA and HMI data.
+# But unlike other examples, we have to ``&`` the individual queries.
+
+search_aia = (a.Time('2020/03/04 00:00', '2020/03/04 00:01') & a.Instrument.aia)
+search_hmi = (a.Time('2020/03/04 00:00', '2020/03/04 00:01')
+              & a.Instrument.hmi & a.Physobs.los_magnetic_field)
+
+result = Fido.search(search_aia | search_hmi)
+print(result)


Test patch: