def METHOD_NAME(self):
    """Test MdfFile API"""
    with MdfFile(abidata.ref_file("tbs_4o_DS2_MDF.nc")) as mdf_file:
        repr(mdf_file); str(mdf_file)
        assert len(mdf_file.structure) == 2
        assert mdf_file.params["nsppol"] == 1
        exc_tsr = mdf_file.get_tensor("exc")
        rpa_tsr = mdf_file.get_tensor("rpa")
        gw_tsr = mdf_file.get_tensor("gwrpa")
        rpa = mdf_file.get_mdf("rpa")
        repr(rpa); str(rpa)
        rpa.to_string(with_info=True, verbose=2)
        assert rpa.num_qpoints == 6
        assert rpa.num_qpoints == len(rpa.qfrac_coords)
        assert mdf_file.qpoints == rpa.qpoints
        assert np.all(mdf_file.qfrac_coords == rpa.qfrac_coords)
        assert  mdf_file.params.get("nsppol") == 1
        tensor_exc = mdf_file.get_tensor("exc")
        tensor_exc.symmetrize(mdf_file.structure)
        if self.has_matplotlib():
            # Test plot_mdfs
            mdf_file.plot_mdfs(cplx_mode="Im", mdf_type="all", qpoint=None, show=False)
            mdf_file.plot_mdfs(cplx_mode="RE", mdf_type="all", qpoint=0, show=False)
            mdf_file.plot_mdfs(cplx_mode="re", mdf_type="all", qpoint=mdf_file.qpoints[0], show=False)
            tensor_exc.plot(title="Si macroscopic dielectric tensor (Reduced coord)")
            tred = tensor_exc.to_array(red_coords=True)
            assert len(tred) == 300
            tcart = tensor_exc.to_array(red_coords=False)
            assert len(tcart) == 300
        if self.has_nbformat():
            mdf_file.write_notebook(nbpath=self.get_tmpname(text=True))