Repository: sunpy/sunpy

Issue:
MultipleMatchError when loading a GONG map with sunpy.map.Map in 5.1.0rc 
### Describe the bug

Probably related to https://github.com/sunpy/sunpy/issues/7204, when loading a GONG map with sunpy.map.Map with sunpy 5.1.0rc **and pfsspy 1.2.0 installed**, a MultipleMatchError is raised: 

> MultipleMatchError: Too many candidate types identified ([<class 'sunpy.map.sources.gong.GONGSynopticMap'>, <class 'pfsspy.map.GongSynopticMap'>]). Specify enough keywords to guarantee unique type identification.


### To Reproduce

``` python
>>> import sunpy
>>> from pfsspy.sample_data import get_gong_map
>>> gong_fname = get_gong_map()
>>> gong_map = sunpy.map.Map(gong_fname)
MultipleMatchError: Too many candidate types identified ([<class 'sunpy.map.sources.gong.GONGSynopticMap'>, <class 'pfsspy.map.GongSynopticMap'>]). Specify enough keywords to guarantee unique type identification.
```

### Screenshots

_No response_

### System Details

sunpy Installation Information

General
#######
OS: Ubuntu (22.04, Linux 6.2.0-36-generic)
Arch: 64bit, (x86_64)
sunpy: 5.1.0rc1
Installation path: /home/jagies/mambaforge/envs/sunpyrc/lib/python3.9/site-packages/sunpy-5.1.0rc1.dist-info

Required Dependencies
#####################
astropy: 5.3.4
numpy: 1.26.0
packaging: 23.2
parfive: 2.0.2

Optional Dependencies
#####################
asdf: 3.0.1
asdf-astropy: 0.4.0
beautifulsoup4: 4.12.2
cdflib: 0.0.0
dask: 2023.11.0
drms: 0.6.4
glymur: 0.12.8
h5netcdf: 1.3.0
h5py: 3.10.0
lxml: 4.9.3
matplotlib: 3.5.3
mpl-animators: 1.1.0
pandas: 2.1.3
python-dateutil: 2.8.2
reproject: 0.12.0
scikit-image: 0.22.0
scipy: 1.11.3
sqlalchemy: 2.0.23
tqdm: 4.66.1
zeep: 4.2.1

pfsspy: 1.2.0


### Installation method

pip


Discussion:
As I added to the description above: When I uninstall the pfsspy (1.2.0) package and load a GONG manually, the error doesn't occur any more (obviously, because class 'pfsspy.map.GongSynopticMap' is not available any more).
Thanks for the report.

Working around this bug will be fun.
Since pfsspy is deprecated, and sunpy 5.1 has the same map source, I think a reasonable fix here would be to special case using the sunpy map source if only the pfsspy and sunpy GONG map sources are found, somewhere around here: https://github.com/sunpy/sunpy/blob/bc8f08fe912adb1396e1a0b976ae98bdc32170a8/sunpy/util/datatype_factory_base.py#L83

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -198,7 +198,11 @@ def __init_subclass__(cls, **kwargs):
         cls.__doc__ += textwrap.indent(_notes_doc, "    ")
 
         if hasattr(cls, 'is_datasource_for'):
-            cls._registry[cls] = cls.is_datasource_for
+            # NOTE: This conditional is due to overlapping map sources in sunpy and pfsspy that
+            # lead to a MultipleMatchError if sunpy.map and pfsspy.map are imported.
+            # See https://github.com/sunpy/sunpy/issues/7294 for more information.
+            if f'{cls.__module__}.{cls.__name__}' != "pfsspy.map.GongSynopticMap":
+                cls._registry[cls] = cls.is_datasource_for
 
     def __init__(self, data, header, plot_settings=None, **kwargs):
         # If the data has more than two dimensions, the first dimensions
diff --git a/sunpy/map/sources/gong.py b/sunpy/map/sources/gong.py
--- a/sunpy/map/sources/gong.py
+++ b/sunpy/map/sources/gong.py
@@ -24,6 +24,10 @@ class GONGSynopticMap(GenericMap):
     array of 242×256 pixels covering the solar disk. These magnetograms are used to derive
     synoptic maps which show a full-surface picture of the solar magnetic field.
 
+    Notes
+    -----
+    If you have ``pfsspy`` installed this map source will be used instead of the one built into ``pfsspy``.
+
     References
     ----------
     * `GONG Page <https://gong.nso.edu/>`_


Test patch: